i have Query will you help me?
i have a query i have 6 scene A,B,C,D,E,F
What i want:-
First on Click Created Button:- A>B , B>C , C>D, D>E, E>F Then on Back Press:- F>D Then on Back Press:- D>B Then on Click Created Button:- B>E Then on Back Press:- E>A i try it but i am unable do number 5: E>A on Back Press will you help me ??
Main.js
render() {
return (
<Router createReducer={reducerCreate} sceneStyle={{ backgroundColor: '#F7F7F7' }}><Scene key='root'>
<Scene key='screen1' component={Screen1} title='Screen1' initial={true}/>
<Scene key='screen2' component={Screen2} title='Screen2' />
<Scene key='screen3' component={Screen3} title='Screen3' />
<Scene key='screen4' component={Screen4} title='Screen4' type={ActionConst.REPLACE} />
<Scene key='screen5' component={Screen5} title='Screen5' />
<Scene key='screen6' component={Screen6} title='Screen6' type={ActionConst.REPLACE} />
</Scene>
</Router>
)
}
Screen1.js
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => {
Actions.screen2()
}}>
<Text style={styles.welcome}>
NEXT
</Text>
</TouchableOpacity>
</View>
)
}
another Screen2.js to Screen6.js almost Same like Screen1.js
I'm really not sure how you would do that. Calling Actions.screen1() doesn't work?
Hello Sir, I am able to perform the Actions.screen1() functionality in the project. The only thing which I am not able to do is "Back stack management" with router flux in the project.
What i want is :- Screen A - When button is clicked ,it goes to Screen B.(on Back Press of Screen A it should exit the app) Screen B - When button is clicked ,it goes to Screen C.(on Back Press of Screen B it should go on Screen A) Screen C - When button is clicked ,it goes to Screen D.(on Back Press of Screen C it should go on Screen A) Screen D - When button is clicked ,it goes to Screen E.(on Back Press of Screen D it should go on Screen B) Screen E - When button is clicked ,it goes to Screen F.(on Back Press of Screen E it should go on Screen A) Screen F - When button is clicked ,it exits from the app.(on Back Press of Screen F it should go on Screen D)
I tried my best,handling the back stack but was unable to go to Screen A on the Back Press of Screen E.
Thanks :-)
yeah I'm really not sure - I guess you would have to track the nav state and then decide where to take it from there. The folks on the react-native-router-flux package may be of more help too - I haven't used RNRF it quite a while.