Closed
Description
Version
Tell us which versions you are using:
- react-native-router-flux v3.38.0
- react-native v0.41.2
Expected behaviour
When creating all scenes directly as children of Router, it is enough to have the drawer scene as the root scene, i.e.
<Router>
<Scene key="drawer" component={NavigationDrawer} open={false}>
<Scene key="requiredBecauseOfDrawer">
<Scene key="scene1" component={Scene1} />
<Scene key="scene2" component={Scene2} />
</Scene>
</Scene>
</Router>
So when creating the scenes with Actions.create() I think it should be the same:
const scenes = Actions.create(
<Scene key="drawer" component={NavigationDrawer} open={false}>
<Scene key="requiredBecauseOfDrawer">
<Scene key="scene1" component={Scene1} />
<Scene key="scene2" component={Scene2} />
</Scene>
</Scene>
)
and then:
<Router scenes={scenes} />
Actual behaviour
When my scenes are defined using Actions.create() and I then click a button to open the drawer, i get the error: 'No parent is defined for route=drawer'.
It works again when I add another surrounding scene, like this:
const scenes = Actions.create(
<Scene key="root">
<Scene key="drawer" component={NavigationDrawer} open={false}>
<Scene key="requiredBecauseOfDrawer">
<Scene key="scene1" component={Scene1} />
<Scene key="scene2" component={Scene2} />
</Scene>
</Scene>
</Scene>
)
Steps to Reproduce
- Define scenes using Actions.create() with drawer scene as the top level scene
- Click button that calls
Actions.refresh({ key: 'drawer', open: true })