Skip to content

useBoolean ​

Category
Utilities

Hook provides a boolean state and a function to toggle the boolean value

typescript
import { useBoolean } from '@elysiumorg/solid-use';

Usage ​

typescript
const [on, toggle] = useBoolean()

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValue?booleanfalseThe initial boolean value