lndsld

Home > @lndsld/react-hooks > useToggle

useToggle() function

Create boolean toggle

Signature:

declare function useToggle(value?: boolean): [boolean, () => void, ToggleAdditionalAPI];

Parameters

Parameter Type Description
value boolean (Optional) value to sync

Returns:

[boolean, () => void, ToggleAdditionalAPI]

current toggle value, function to invert it and additional API