Modal
NB: Experimental package!
Setup
- Install
yarn add react-with-native-modal
- Wrap your whole app in the ModalProvider
import { ModalProvider } from "react-with-native-modal";
// and
<ModalProvider>
<YourApp />
</ModalProvider>;
Usage
Whenever you need a modal, use this hook:
import { useModal } from "react-with-native-modal";
// and
const { handleModal } = useModal();
// and then
<Button onClick={() => handleModal(Element | string)}>Show a modal</Button>;
Modal
NB: Experimental package!
Setup
- Install
yarn add react-with-native-modal
- Wrap your whole app in the ModalProvider
import { ModalProvider } from "react-with-native-modal";
// and
<ModalProvider>
<YourApp />
</ModalProvider>;
Usage
Whenever you need a modal, use this hook:
import { useModal } from "react-with-native-modal";
// and
const { handleModal } = useModal();
// and then
<Button onClick={() => handleModal(Element | string)}>Show a modal</Button>;