Docs
useBoolean
Manage a boolean state with the useBoolean hook, providing methods to set it to true, false, or toggle between them.
Installation
Usage
API Reference
Parameters
Name | Type | Description |
---|---|---|
defaultValue? | boolean | The initial value for the boolean state (default is false ). |
Returns
Name | Type | Description |
---|---|---|
setFalse | () => void | Function to set the boolean state to false . |
setTrue | () => void | Function to set the boolean state to true . |
setValue | Dispatch<SetStateAction<boolean>> | Function to set the boolean state directly. |
toggle | () => void | Function to toggle the boolean state. |
value | boolean | The current boolean state value. |