useBoolean ​
Hook provides a boolean state and a function to toggle the boolean value
typescript
import { useBoolean } from '@siberiacancode/reactuse';
Usage ​
typescript
const [on, toggle] = useBoolean()
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
initialValue? | boolean | false | The initial boolean value |