Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNavigator config to pass params down #68
Open
Comments
|
For more info (if needed), this came about because I needed to pass params down from a tab navigator to a child stack navigator. Here's a link to the stack overflow, which has a link to a snack demo. Thanks for the work around, @ericvicenti ! |
This was referenced Mar 5, 2019
richeterre
added a commit
to richeterre/jumu-app
that referenced
this issue
Jul 30, 2019
Instead of passing the selected contest as a nav param to the nested navigation structure (tab + stack navigators), which is tricky because params don't propagate to child navigators (see react-navigation/rfcs#43 and react-navigation/rfcs#68), we wrap the navigator structure with a ContestNavigator that receives the current contest as a prop, and passes it forward to its navigation screens as a param. The RootView component tracks the current contest and renders either a ContestNavigator or (if no contest selected) a contest picker.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was chatting with @geirman and I think we may want to add
passParamsto the navigator config:Say you go from Main
.navigate('MyTabs', {foo: 'bar'}).. Thanks to the proposedpassParams, screens A and B would have access to the "foo" param.I'll try to get to this in the coming weeks. Let me know if anybody wants to take a stab at implementing this.. I'd be happy to support you.
cc @brentvatne