I want to show some data in Modal, I need to use modal inside of tab view
react-native-tab-view
react-native-modal
but when i add modal inside of tab view then initially modal is render every time and cannot be dismissed. I already tested using modal in different way...
- Inside of file
- outside of file
- Inside of Function
- using as a component
every time Modal render first and cannot be dismissed.
The best way to achieve that is by using a
Global Modal.At first, create a folder called
connected-componentsand create your modal as in this exampleUse your reducer engine to change
visiblevalue by creating two actions one to show the modal and another to hide it, You can also pass your custom data using the reducer.To make it work just add your
Global Modalcomponent to yourApp.jsand by this way you can open it from every place on your app.If you have any questions just add a comment, Hope this help you through.