react-native-safe-modal
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-safe-modal

Weekly Downloads

2

Version

0.1.0

License

ISC

Unpacked Size

9.74 kB

Total Files

11

Last publish

Collaborators

  • mutagen-d