question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigation Conflicts with React Native Modal Component

See original GitHub issue

If I render a <Modal /> component from react-native within a native stack and navigate while dismissing the modal, it either freezes with the modal open, freezes with the modal shut, or closes the modal, reopens the modal, then freezes. Generally, it freezes.

We mostly use react-navigation, but I also think there are good uses for the modal component. We have a case where we have a modal that asks the user if they want push notifications when they’ve met some criteria. They can press no, and then meet the criteria again at a later date. Doing this with the Modal component is much more ergonomic here because of the visible prop. We don’t have to do imperative navigation to handle this.

It’s not entirely clear whether this is a bug here - maybe it’s up to react-navigation to render a modal within a stack, and then have a mechanism for conditionally displaying that. Or maybe is is a bug here, and we need better handling with modals that are not our own. I know I have apps that show iOS modals for stuff like the file picker. What are your thoughts here?

I’ve made a reproduction over here https://github.com/jacobp100/react-native-screens/tree/react-native-modal-example (diff)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tedicommented, Aug 5, 2020

I’m also experiencing the same issue. I ended up creating a new flow for my use case, but I also experienced the same thing when calling React Native Modal on load from a Modal screen.

0reactions
WoLewickicommented, Sep 7, 2020

Closing this in order to keep the discussion in one place (#525).

Read more comments on GitHub >

github_iconTop Results From Across the Web

conflict navigating from modal to modal - Stack Overflow
I'm trying to navigate from ModalScreenInner to ModalScreenOuter , the problem is that the ModalScreenOuter is not shown, I need to close ...
Read more >
What Everyone Is Getting Wrong About React Native Modals
A guide on how to master React Native modal complex flows.​​ And the problem only gets worse when you try to create complex...
Read more >
Troubleshooting | React Navigation
This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation. These issues may or may...
Read more >
Use the React Native Modal Component with React Navigation
In this lesson you will learn how to display and access the React Native Modal component from any of your navigator's screens and...
Read more >
React Modal component - Material UI - MUI
Modal · Manages modal stacking when one-at-a-time just isn't enough. · Creates a backdrop, for disabling interaction below the modal. · It disables ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found