Open
Description
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS
What happened?
We have two screens, and a modal on screen 1 has a button that when pressed, dismisses the modal and navigates to screen 2.
However, the modal of screen 1 gets presented again on screen 2, without any ref.current?.present()
being called:
It has to do with a useState
hook that gets called too in the modal, so it might be related to a re-render operation of screen 1.
Note: the provided Snack does not run for some reason that I don't understand but have already reported. Just paste the whole App.tsx into a local project and run it from there.
Note that the problem disappears if you enable the setTimeout
on line 57.
Reproduction steps
- Take the code from the reproduction example here: https://snack.expo.dev/@yolpsoftware/bottomsheetmodal-getting-presented-again-on-the-next-screen
- If you cannot run the Snack, paste the code (just one file, App.tsx) into a local project and run it from there
Reproduction sample
https://snack.expo.dev/@yolpsoftware/bottomsheetmodal-getting-presented-again-on-the-next-screen