4

I have two sub scene in my react-native-router-flux Router like

<Router>
  <Scene key="root" ... >
    <Scene key="login" ... />
    <Scene key="parent" component={drawer}>
      <Scene key="page1" ... />
      <Scene key="page2" ... />
    </Scene>
  </Scene>
</Router>

Now, I'm in login scene. If I want to call page2, I'm using the following snippet.

Actions.parent()
Actions.page2()

It is working. But, Before rendering the page2 It is executing the page1 also, Since it is the initial element. How to open page2 without executing the page1?

Thanks in Advance,

Sriraman
  • 7,658
  • 4
  • 40
  • 60

1 Answers1

2

Try this -

import { Actions, ActionConst } from 'react-native-router-flux';

<Button onPress={() => {
    Actions.parent({type:ActionConst.RESET});
    Actions.page2();
}}>
BootCamp
  • 46
  • 4