React-native-router-flux: Issue when passing data to tab scene

Created on 29 Sep 2016  路  3Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux 3.35.0
  • react-native 0.33.0

Expected behaviour

Scene config

<Scene key="modal" component={Modal} >
    <Scene key="root" tabs={true}>
      <Scene key="pageOne" component={PageOne}/>
      <Scene key="PageTwo" component={Drawer} open={false}>
        <Scene key="main" tabs={true}>
          <Scene key="home" component={Home}>
        </Scene>
      </Scene>
    </Scene>
  </Scene>

PageOne.js (onPress handler)

Actions.drawer({ session: 'some value' })

PageTwo.js (in render)

console.log(this.props.session) // null

Actual behaviour

Returns null

I can provide more code if needed.

question

All 3 comments

Unsure if this is the ideal way to do this but:

Actions.drawer()
Actions.refresh({ key: 'drawer', session: Session })

Works. Do certain Actions not allow the passing of props or is something more complex happening under the hood?

Version 3.35.0 does not support passing props to tab routes.

1057 and #1236 appends this functionality, but before official release you could test it by installing RNRF with:

npm install --save-dev https://github.com/aksonov/react-native-router-flux.git
EDIT:
npm install --save https://github.com/aksonov/react-native-router-flux.git

Saved me a headache!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wootwoot1234 picture wootwoot1234  路  3Comments

VictorK1902 picture VictorK1902  路  3Comments

jgibbons picture jgibbons  路  3Comments

xnog picture xnog  路  3Comments

booboothefool picture booboothefool  路  3Comments