useDisclosure ​
Hook that allows you to open and close a modal
typescript
import { useDisclosure } from '@siberiacancode/reactuse';
Usage ​
typescript
const { opened, open, close, toggle } = useDisclosure();
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
initialValue | boolean | - | The initial value of the component |
options.onOpen? | () => void | - | The callback function to be invoked on open |
options.onClose? | () => void | - | The callback function to be invoked on close |