useDisclose | NativeBase | Universal Components for React and React Native

Search
K
Hire us
If you are starting a new project, please try gluestack-ui for better performance and new design.
useDisclose
useDisclose is a custom hook used to help handle common open, close, or toggle scenarios. It can be used to control feedback component such as Modal, AlertDialog, Drawer, etc.
Import
Copy
import { useDisclose } from 'native-base';
Example
Playground
Return value
The useDisclosure hook returns an object with the following fields:
isOpen: ( boolean ) Show the component; triggers the enter or exit states.
onClose: ( function ) Callback function to set a falsy value for the isOpen parameter.
onOpen: ( function ) Callback function to set a truthy value for the isOpen parameter.
onToggle: ( function ) Callback function to toggle the value of the isOpen parameter.
Nativebase logo
MadeWithNativeBase