Navigator config to pass params down
ericvicenti opened this issue · 1 comments
ericvicenti commented
I was chatting with @geirman and I think we may want to add passParams
to the navigator config:
createStackNavigator({
Main,
MyTabs: createTabNavigator({
A,
B,
}, { passParams: [ 'foo' ] })
})
Say you go from Main .navigate('MyTabs', {foo: 'bar'})
.. Thanks to the proposed passParams
, 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
geirman commented
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 !