useToggle
Callable
Parameters
optionalinitialValue: boolean = false
The initial value of the boolean.
Returns readonly [value: boolean, toggle: () => void]
A tuple containing the boolean value and a function that toggles its value.
The initial value of the boolean.
A tuple containing the boolean value and a function that toggles its value.
Returns a tuple containing a boolean value and a function that toggles its value. The initial boolean value defaults to false if not provided.