? In React Native, using action-native-router-flux, ...">

React Native + response-native-router-flux: how to apply hideNavBar to only one <Scene / ">?

In React Native, using action-native-router-flux, I have two <Scene/>, and when I apply hideNavBarto the first Login, it also applies to the second Home, although they are on the same level. How can I apply hideNavBarto only one <Scene/>, Login?

const RouterWithRedux = connect()(Router)
const store = configureStore()

export default class App extends Component {
  render() {
    return (
      <Provider store={store}>
        <RouterWithRedux>
          <Scene key='root'>
            <Scene component={Login} hideNavBar initial={true} key='login' title='Login'/>
            <Scene component={Home} key='home' title='Home'/>
          </Scene>
        </RouterWithRedux>
      </Provider>
    )
  }
}
+1
source share
1 answer

. , actions/PUSH. : .

const RouterWithRedux = connect()(Router)
const store = configureStore()

export default class App extends Component {
  render() {
    return (
      <Provider store={store}>
        <RouterWithRedux>
          <Scene key='root'>
            <Scene component={Login} hideNavBar initial={true} key='login' title='Login'/>
            <Scene component={Home} hideNavBar={false} key='home' title='Home'/>
          </Scene>
        </RouterWithRedux>
      </Provider>
    )
  }
}

NavBar . , .

+2

Source: https://habr.com/ru/post/1652168/


All Articles