-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
My application is divided in multiple sub applications that has its own route.
For example, the Login page is a part of the app that work completely independently of the rest of the app. So I am trying to do the following:
index.js
const scenes = Actions.create(
<Scene key="start" hideNavBar={true}>
<Scene key="landing" component={Landing} initial={true} />
<Scene key="login" schema="modal" direction="vertical" component={Login}></Scene>
</Scene>
);
The Landing component calls Login to open a new modal with the login scene.
Login should have its own route, the parent shouldn't be aware of what the Login scene does, so I am trying to create new scenes in this file.
But if I call Actions with the name of a scene from index.js, in my case I try to go back to the start scene, it doesn't recognize it, so I can't go back. I also tried to use Actions.pop() but it doesn't work either.
login.js
const scenes = Actions.create(
<Scene key="loginContainer">
<Scene key="loginPage1" component={LoginPage1} title="Login" initial={true} leftTitle="Cancel" onLeft={() => {
Actions.startContainer(); // Want to go back to the previous page, this doesn't work
}} />
<Scene key="loginPage2" component={LoginPage2}></Scene>
</Scene>
);
class Login extends Component {
render() {
return (
<Router scenes={scenes} />
);
}
}
Any suggestion how I could do that?
Thanks
brunolemos, cherniv and afshinm
Metadata
Metadata
Assignees
Labels
No labels