Skip to content

useBoolean ​

Category
Utilities

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

NameTypeDefaultNote
initialValue?booleanfalseThe initial boolean value

Contributors ​

Source • Demo