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()' –