Squrler
Squrler

Reputation: 3514

Hiding navigation bar in React Native

I am using React Native Router Flux (https://github.com/aksonov/react-native-router-flux) for the routing in my React Native app.

I would like to hide the navigation bar for some views, but not for others. Is there an easy way to do this?

Upvotes: 2

Views: 2847

Answers (1)

Alejandro
Alejandro

Reputation: 270

Yes, there are some ways to do that.

Say for example you have two scenes and you want to hide the navbar when matching a scene.

according to the RNRF docs you can use hideNavBar property under Navigation Bar

https://github.com/aksonov/react-native-router-flux/blob/master/docs/API_CONFIGURATION.md

basic the code example will look like this

<Scene key="app">
    <Scene key="sceneOne" component={ComponentOne} title="SceneOne"  />
    <Scene key="sceneTwo" hideNavBar={true} component={ComponentTwo} title="SceneTwo"  />
</Scene>

Notice that on "SceneTwo" we use hideNavBar={true}

Upvotes: 1

Related Questions