Home > @lndsld/react-hooks > useToggle
Create boolean toggle
Signature:
declare function useToggle(value?: boolean): [boolean, () => void, ToggleAdditionalAPI];
Parameter | Type | Description |
---|---|---|
value | boolean | (Optional) value to sync |
Returns:
[boolean, () => void, ToggleAdditionalAPI]
current toggle value, function to invert it and additional API