Tell us which versions you are using:
When navigated from a login screen to a nested scene with tabs, all children tab scenes should have a prop passed to the parent scene by Actions
The prop cannot be passed to the parent scene. It will work as expected if I pass it to a child scene using Actions, but I want the prop to be available to all children tab scenes
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
My declarations of the Scenes hierarchy
<Scene key = "main" tabs = {true} hideNavBar = {true} >
<Scene key = "feedTab" hideNavBar = {true} title = " " iconName = "Feed" icon = {TabIcon} >
<Scene key ="home" component = {Feed} title = "Home"/>
</Scene>
<Scene key = "createTripTab" hideNavBar = {true} title = " " iconName = "Create Trip" icon = {TabIcon}>
<Scene key = "createTrip" component = {CreateTrip} title = "Create Trip" />
</Scene>
<Scene key = "findHostTab" hideNavBar = {true} title = " " iconName = "Find Host" icon = {TabIcon} >
<Scene key = "findHost" component = {FindHost} title = "Find Host" />
</Scene>
<Scene key = "profileTab" hideNavBar = {true} title = " " iconName = "Profile" icon = {TabIcon} >
<Scene key = "profile" component = {Profile} title = "Profile" />
</Scene>
</Scene>
Actions.main({user_id: json.user_id}) doesnt work while Actions.createTripTab({user_id: json.user_id}) works
same issue here, @baonguyen2604 did you find any solution or a workaround?
same issue here.
I also encountered this issue. I recommend using Actions.jump('main', {user_id: json.user_id}).
Please check Example project and TabView.js with Actions.tab_5_1({ data: 'test!' })
Please at least add a link
Yes! I found the problem in 'Tab'.
Tabs are 'wrapped' by default - i.e. all children are wrapped by Stack with own nav bar. You may disable wrapping by using wrap={false} for Tabs and check passing props again.
<Scene key="Scene" tabs={true} wrap={false}> <Scene key="someTab" component={SomeTab} title="SomeTab" icon={TabIcon}/> <Scene key="Modal" component={Modal} title="Modal" hideNavBar direction="vertical"/> </Scene>
Here props are find when passing from someTab to Modal via Actions.Modal({someProp: theProp})
Thanks @anuj002, I was looking for a solution for hours!
Most helpful comment
Yes! I found the problem in 'Tab'.
Tabs are 'wrapped' by default - i.e. all children are wrapped by Stack with own nav bar. You may disable wrapping by using wrap={false} for Tabs and check passing props again.
<Scene key="Scene" tabs={true} wrap={false}> <Scene key="someTab" component={SomeTab} title="SomeTab" icon={TabIcon}/> <Scene key="Modal" component={Modal} title="Modal" hideNavBar direction="vertical"/> </Scene>Here props are find when passing from someTab to Modal via Actions.Modal({someProp: theProp})