<ModalProvider/>
, which is going to wrap the whole application and use React Context in order to display the modals on top of everything. createModalStack()
, that we'll use to create the stack <ModalProvider/>
needs to work as expected.<ModalProvider/>
inside of <ApolloProvider/>
and Redux's <Provider/>
just in case modal components might need data from them.<ModalProvider/>
is missing a stack of modals: let's fix that!createModalStack()
and pass its output to <ModalProvider/>
through the only prop the component accepts: stack
. createModalStack()
accepts 2 arguments: a modal configuration object (mandatory) and a default options object (optional):static modalOptions
(Class) or MyModalComponent.modalOptions
(Hooks)<ErrorModal/>
is a regular React component we're using as our 1st modal. React Native Modalfy will register it under the key 'ErrorModal'
. modalConfig
key, ie: const modalConfig = { MyCustomErrorModalName: ErrorModal }
.createModalStack()
API reference to have more in-depth explanations of createModalStack()
mechanics.