Sydney Loteria
Sydney Loteria

Reputation: 10441

React Native Routing

How can go to the next page when I pressed a button without using the NavigatorIOS. is there a way in react native to do that?

I understand how the NavigatorIOS works but my problem is i do not want to have NavigationBar on my Login Page.

Thanks!

Upvotes: 0

Views: 120

Answers (1)

jevakallio
jevakallio

Reputation: 35890

NavigatorIOS has a property navigationBarHidden that you could set when you are in the login screen, e.g. something like:

<NavigatorIOS
  navigationBarHidden={!this.state.isLoggedIn}
  //...
/>

Alternatively you could render your login screen outside the navigator hierarchy:

render: function() {
  if (!this.state.isLoggedIn) {
    return <LoginScreen />;
  }
  return (
    <NavigatorIOS
      //...
    />
  );
},

Both of these examples presume that your button sets a state variable isLoggedIn to true.

Upvotes: 2

Related Questions