Anjali
Anjali

Reputation: 2698

React Native navigationOptions

How can I make navigationOptions visibility to false. I have the following code on my page:

class MainActivity extends Component {


  static navigationOptions = {
    title: 'Welcome',
  };

I don't want welcome to be displayed. I don't want even the top part to be showing up on my phone. Below is the image if my phone:

enter image description here

where the red arrow is pointing, I don't want that top portion to be displayed. How can I make the navigationOption invisible.

Any help will be highly appreciated.

Upvotes: 0

Views: 681

Answers (3)

admin web
admin web

Reputation: 41

`static navigationOptions = { header: null,

}`

Upvotes: 0

Nirmalsinh Rathod
Nirmalsinh Rathod

Reputation: 5186

You need to pass navigationOptions in StackNavigator in your application.:

 MainActivity: {
    screen: MainActivity,
    navigationOptions: {
      header: null,
    }
  },

You can get more information about navigationOptions from this link.

Upvotes: 2

patelarpan
patelarpan

Reputation: 7991

This option done your job

class MainActivity extends Component   {
    static navigationOptions = { 
         header: null 
     };

Upvotes: 1

Related Questions