useBoolean
Custom hook that handles boolean state with useful utility functions.
Custom hook that handles boolean state with useful utility functions.
Usage
import { useBoolean } from "@tilt-legal/cubitt-components/utilities/hooks";
const { value, setTrue, setFalse, toggle } = useBoolean(true);API
Signature
declare function useBoolean(defaultValue?: boolean): UseBooleanReturn;Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
[defaultValue] | boolean | The initial value for the boolean state . | false |
Return Value
| Value | Type | Description |
|---|---|---|
return | UseBooleanReturn | An object containing the boolean state value and utility functions to manipulate the state. |