demo-react-native-router-flux icon indicating copy to clipboard operation
demo-react-native-router-flux copied to clipboard

i have Query will you help me?

Open tjsaini007 opened this issue 8 years ago • 3 comments

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

tjsaini007 avatar Apr 04 '17 13:04 tjsaini007

I'm really not sure how you would do that. Calling Actions.screen1() doesn't work?

spencercarli avatar Apr 05 '17 01:04 spencercarli

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 :-)

tjsaini007 avatar Apr 05 '17 12:04 tjsaini007

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.

spencercarli avatar Apr 06 '17 00:04 spencercarli