-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScreenContainer crashes when rendered inside a React Native Modal #1769
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Same issue here 🤕 |
@aweary did you ever find a solution to this issue? thank you 🙏 |
This is still an issue. @eric-everbright I wrote my own Modal component in use of react-native-portal and react-native-reanimated library. |
We also encountered the issue. Here's a pseudo-code: <Modal>
<NavigationContainer independent>
<Stack.Navigator>
<Stack.Screen [...] />
</Stack.Navigator>
</NavigationContainer
</Modal> Our workaround was to set detachInactiveScreens to Unfortunately, this is a workaround and it's only available on Stack Navigator, not on Native Stack Navigator. |
Yeah, took a look. We (in Looks like
Alternative would be to wait for #2045, which shall introduce native modals controlled by this library. If you have any idea of different way for solving this, let me know. |
I'm revisiting this issue with thoughts that we won't be able to solve this particular issue on the library side, thus I'll close it. However I do leave discussion unlocked, if there is any breakthrough don't hesitate to ping me. |
The Navigation router's stack works inside a React Native modal. You can try it out in the medley sample. It uses a |
You motivate me @grahammendick |
That's great. If you've any questions I'll do my best to help |
any updates on this? |
Description
ScreenContainer
tries to read aFragmentManager
from theReactRootView
but if this is being rendered within aModal
component the native view will be attached to aDialogRootViewGroup
which is attached to the nativeandroid.app.Dialog
, so its not a child of aReactRootView
. ADialog
is the only way to trap screen reader focus on Android, so we have some use cases where we have to structure it this way.As far as I can tell, it's just trying to read a
FragmentManager
fromReactRootView
but it should be able to find aFragmentManager
when nested insideDialogRootViewGroup
as wellSteps to reproduce
createNativeStackNavigator
Modal
Snack or a link to a repository
https://gist.github.com/aweary/1f031cedb1cf0998597119acfa2373b7
Screens version
3.18.2
React Native version
0.70
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: