0
我有一个相当充实的项目使用react-native-router-flux
,我试图通过props
传递一个对象。通常,我可以拨打Actions.someKey({ someProp: object })
进行导航,但我试图使用rightButtonImage
进行导航,因为它无法访问组件的props
。通过道具从navBar按钮使用React-Native-Router-Flux
例如:
Router.js
<Router>
<Scene1
rightButtonImage={someImage}
onRight={() => Actions.sceneTwo()}
/>
<Scene2 key="sceneTwo" />
</Router>
我想传递一个场景1的组件具有访问对象,当我移动到第二幕:。
你想送你'Scene2'的'someImage'价值? –
否Scene1的组件具有一个对象作为我需要传递给Scene2的道具。 – MattyK14
你可以存储它并将它作为自己的'prop'传递给'Actions.sceneTwo()' –