PXD

useToggleValue

Toggles between truthy/falsy values with optional custom values.

Exports

function useToggleValue(
  initialValue?: boolean,
  options?: Options,
): {
  value: Ref<boolean>
  toggle: (newValue?: boolean) => void
}

Params

NameTypeDescription
initialValuebooleanThe initial toggle state

Source

Source