Skip to content

Commit c0b68b6

Browse files
committed
docs: added guidance on the location of modal provider
1 parent 9e8cd25 commit c0b68b6

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![npm](https://img.shields.io/npm/v/react-native-use-modal?color=brightgreen)](https://www.npmjs.com/package/react-native-use-modal)
44
[![npm](https://img.shields.io/npm/dw/react-native-use-modal)](https://www.npmjs.com/package/react-native-use-modal)
55

6-
A way to create a modal that is easy to reuse, easy to encapsulate, and returns the result as a Promise.
6+
A way to create a modal that is easy to reuse, easy to encapsulate, and returns the result as a promise.
77

88
The goal of `react-native-use-modal` is to make all the functions of `react-native-modal` available and convenient to use at the same time.
99

@@ -40,6 +40,27 @@ const App = () => {
4040
};
4141
```
4242

43+
If you are already using a different provider, make the `ModalProvider` a child of the other provider.
44+
Otherwise, the modal will not get the values broadcast by other providers.
45+
46+
```tsx
47+
import {Provider} from 'react-redux';
48+
49+
const App = () => {
50+
return (
51+
<Provider store={store}>
52+
<FooProvider>
53+
<BarProvider>
54+
<ModalProvider>
55+
// ...
56+
</ModalProvider>
57+
</BarProvider>
58+
</BarProvider>
59+
</Provider>
60+
);
61+
};
62+
```
63+
4364
## Usage
4465

4566
### Declare modal as hook with `createUseModal`

0 commit comments

Comments
 (0)