Reputation: 2126
I have a fairly fleshed out project using react-native-router-flux
and I'm trying to pass an object through props
. Normally I could call Actions.someKey({ someProp: object })
for the navigation, but I'm trying to navigate using the rightButtonImage
where it doesn't have access to the component's props
.
For instance:
Router.js
<Router>
<Scene1
rightButtonImage={someImage}
onRight={() => Actions.sceneTwo()}
/>
<Scene2 key="sceneTwo" />
</Router>
I want to pass an object that Scene1's component has access to, when I move to Scene2.
Upvotes: 0
Views: 638
Reputation: 41
It can be helpful for you: In each component i.e in componentDidMount you can do something like that:
Actions.refresh({
rightTitle: "Next",
rightButtonTextStyle: {color: 'red'},
onRight: this.goSomewhere,
rightButtonImage: someImage
})
Upvotes: 1