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
Unable to pass params to all the createMaterialTopTabNavigator children #4811
Comments
Hi @brbrr ! You're getting this problem because you're calling the child screen first. So to fix that, basically call the EventStack I fixed your example and now it's working, please check it on |
Thanks, @eriveltonelias, but it looks like you updated my navigators set up. I actually omitted some of the screens in these navigators for simplicity sake. |
@brbrr gotcha. I follow your code and fix with your new update, try again, please. |
oh, that's works now, Thanks! But it looks like it screws up the |
I am having identical issue. When I am navigating to the TopTabNavigation the children of the TabNavigation are not receiving the params I am passing. Here is how my routers are configured: const TopTabNav = createMaterialTopTabNavigation({ const BottomNavigation = createBottomTabNavigation({ RootStack: { So I am doing navigation.navigate(MainNav, { test: 1}), and I am taken as expected to the required route i.e TopTabNav but the children of the route (Dashboard and Menu screens) are not getting the params. I also tried to navigation.navigate(TopTabNav, { test: 1 }), but I am also getting same result, no params passed to the children of TopTabNav. What am I doing wrong here? Very much appreciate any help. |
|
Is there a way to find what version the dangerouslyGetParent() was available? I seems I cannot get the |
@ProfessionalAmateur - you should update to react-navigation@3. i can't recall which version it was added in but if you look through code at the various tags here on https://github.com/react-navigation/react-navigation/releases you can find it |
@brentvatne if I have two AppContainer how to get params from the other screen in separate other AppContainer? |
look very promising at first but if u change
you will get undefined |
Current Behavior
When I navigate to
createMaterialTopTabNavigator
passed params are not shared to its children. When I navigate to some of the children ofcreateMaterialTopTabNavigator
- params are not shared with other childrenExpected Behavior
When I navigate to
createMaterialTopTabNavigator
- params passed are passed to its children, so I can share data with all the screens inside TabNavigatorHow to reproduce
Snack:
https://snack.expo.io/S1Odm_XBmhttps://snack.expo.io/r1imvK7SQnavigation.state.params
printed on both screens.navigation.navigate('EventTab', {test: 1} )
tonavigation.navigate('Event', {test: 1} )
, and check ifnavigation.state.params
printed on both screensYour Environment
The text was updated successfully, but these errors were encountered: