react-native-safe-modal
v0.1.0
Published
Safely open mutiple modals. One modal per time will be shown.
Downloads
1
Readme
react-native-safe-modal
Safely open mutiple modals. One modal per time will be shown.
Installation
with npm
npm install react-native-safe-modal
with yarn
yarn add react-native-safe-modal
Usage
react-native-safe-modal
includes <SafeModalProvider />
component, and SafeModalFactory()
function.
Place <SafeModalProvider />
on top of components. Create <SafeModal />
by SafeModalFactory()
import Modal from 'react-native-modal'
import { SafeModalProvider, SafeModalFactory } from 'react-native-safe-modal'
const SafeModal = SafeModalFactory(Modal, { isVisibleKey: 'isVisible', onModalHideKey: 'onModalHide' })
const App = () => {
return (
<SafeModalProvider>
<SomeComponents>
<SafeModal isVisible />
<SafeModal isVisible />
</SomeComponents>
</SafeModalProvider>
)
}