Skip to content
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

<Tabs>Properties passing to children <Scene>'s #2991

Closed
VilleKokkarinen opened this issue Apr 12, 2018 · 2 comments
Closed

<Tabs>Properties passing to children <Scene>'s #2991

VilleKokkarinen opened this issue Apr 12, 2018 · 2 comments

Comments

@VilleKokkarinen
Copy link

VilleKokkarinen commented Apr 12, 2018

Version

  • react-native-router-flux v4.0.0-beta.26
  • react-native v0.54.2

Expected behaviour

Expecting props being passed to the <Tabs> to inherit to all of it's children <Scene>'s

  • via Actions.jump("Tabs", {property: data} )

Actual behaviour

Only the first scene inside <Tabs> received props, the rest were not so lucky.

Steps to reproduce

1.

  • 2 or more Scene's inside a component

  <Tabs key="tabs tabBarPosition={'bottom'} >
  <Scene key="Page1" component={Page1} title="Page1" onLeft={Actions.pop} />  
  <Scene key="Page2" component={Page2} title="Page2" onLeft={Actions.pop} /> 
  </Tabs> 

2.

Navigating to the Tabs
Actions.jump("tabs", { property:this.state.data } )

3.

Only Page 1 received props named "property".

Though

Solved for the meanwhile by just Actions.Jump(ing) with the props, to every page that needs them

@aksonov
Copy link
Owner

aksonov commented Jun 6, 2018

Correct, it is not supported functionality, PR is welcome.

@aksonov aksonov closed this as completed Jun 6, 2018
@anuj002
Copy link

anuj002 commented Jul 11, 2019

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})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants