useDisclosure
A hook to control open/close state.
Import#
Return value#
The useDisclosure hook returns an object with the following properties:
| Name | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | false | The current state of the hook. |
close | function | Changes the state to false. | |
open | function | Changes the state to true. | |
toggle | function | Toggles the state between true and false. |
Usage#
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
^Live Editor