useDisclose | NativeBase | Universal Components for React and React Native

Search
K
Hire us
Data Display
Typography
Disclosure
Media and Icons
Others
Please opt in to our enterprise plan (coming soon) for priority support with NativeBase. If you are starting a new project, we recommend using gluestack-ui. For your existing projects, you can utilize @gluestack-ui/themed-native-base (beta).
useDisclose
useDisclose handles common open, close, or toggle scenarios and can control feedback components 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