React-Native-Router-Flux Actions. Refresh the tabs and keep the navigation scene stack.
here is my problem,
I have this config using react-native-router-flux 3.39.1 and RN 0.40.0:
<Router >
<Scene key='bottomBar' tabs hideNavBar tabBarStyle={Styles.tabBar}>
<Scene
key='Tab-A'
title='Tab A'
icon={TabIcon}
onPress={() => { Actions.refresh({ key: 'Scene-A' }) }}
style={Styles.main}>
<Scene key='Scene-A' component={SceneA} style={Styles.main} />
<Scene key='Scene-A-1' title='Scene A 1' component={SceneA1}/>
<Scene key='Scene-A-2' title='Scene A 2' component={SceneA2}/>
</Scene>
<Scene
key='Tab-B'
title='Tab B'
icon={TabIcon}
onPress={() => { Actions.refresh({ key: 'Scene-B' }) }}
style={Styles.main}>
<Scene key='Scene-B' component={SceneA} style={Styles.main} />
</Scene>
</Scene>
</Router>
Problem:
When from Scene-A I popTo Scene-A-1 go to Scene-B tab , if I click on Tab-A the router presents Scene-A instead of Scene-A-1 .
In fact, my new navigation stack is:
- Tab A
| __ Scene-A
| __ Scene-A-1
| __ Scene-A
Instead of:
- Tab A
| __ Scene-A
| __ Scene-A-1
I saw that this pull request might fix it, but it doesn't work on my side.
How do I do to update the scene with the latest navigation stack? Should I use a different kind of ActionConst?
thank
+3
source to share
No one has answered this question yet
Check out similar questions: