-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I'm trying to achieve a Navigator.popToRoute effect as follows:
<Router>
<Route hideNavBar={true} name="launch" component={connect()(Launch)} initial={true}/>
<Route name="router1" schema="default" type="push">
<Router hideNavBar={true}>
<Route hideNavBar={true} name="aRoute" component={connect()(ARoute)} schema="default" type="reset"/>
<Route hideNavBar={true} name="bRoute" component={connect()(BRoute)} schema="default" type="push"/>
</Router>
</Route>
<Route name="router2" schema="default" type="push">
<Router hideNavBar={true}>
<Route hideNavBar={true} name="cRoute" component={connect()(CRoute)} schema="default" type="push"/>
<Route hideNavBar={true} name="dRoute" component={connect()(DRoute)} schema="default" type="push"/>
</Router>
</Route>
</Router>
The flow would be as follows:
-
Actions.route('router1') from launch to push aRoute
-
Actions.route('bRoute') from aRoute to push bRoute
-
Actions.route('router2') from bRoute to push router2, which defaults to cRoute
-
Actions.route('dRoute') from cRoute to push dRoute
-
call Actions.currentRouter.parentRoute.parent.pop() to pop router2 and return to router1 (on bRoute)
-
Once popped back to bRoute, I call Actions.route('router2') again, but I get the following error:
No current router is set
Would appreciate your advice whether this is the correct way to accomplish this popToRoute kind of effect, or if there is a better way to do so.
Thanks
Metadata
Metadata
Assignees
Labels
No labels