0

I have below codebase

const drNav = createDrawerNavigator(
  {

    A: {
      screen: A,
      navigationOptions: {
        title: 'A',
      },
    },
    B: {
      screen: B,
      navigationOptions: {
        title: 'B',
      },
    },
    C: {
      screen: C,
      navigationOptions: {
        title: 'C',
      },
    },
    D: {
      screen: D,
      navigationOptions: {
        title: 'D',
      },
    }
  }
)

But the title is not being shown on header, it is blank

I have also tried setting title in each screen

static navigationOptions = {
    title: 'A'
 }

But this is not working, What I need to change to make it working,

Please advise. Thanks

Md. Parvez Alam
  • 4,326
  • 5
  • 48
  • 108

1 Answers1

1

You should pass a function to navigation options.

    const drNav = createDrawerNavigator(
      {

        A: {
          screen: A,
          navigationOptions: () => ({
            title: 'A',
          }),
        },

You can find futher information on the docs.

Vinicius
  • 1,131
  • 2
  • 11
  • 25