useToggleState
This hook tracks a boolean value and toggles between its two states.
This guide explains how to use the useToggleState
hook.
For example, you can use this hook to display a checkbox or a Switch that toggles a Focus Modal.
Entity Name | Actions |
---|---|
foo | |
bar | |
baz |
Usage#
API Reference#
useToggleState Parameters#
Name | Type | Default |
---|---|---|
initial | boolean | false |
Was this guide helpful?
useToggleState Return Value#
Name | Type | Description |
---|---|---|
state | StateData | - |
Was this guide helpful?