Introduction

This is an example of React Navigation Header Customization in React Native using Navigation Options. In this example, we will see how to customize the Navigation Bar/ Navigation header. React Native does not provide any header by default, it comes when we add React Navigation to switch the activity.

Sometimes we have to customize the header according to the needs and we can easily do it with the help of navigation options. In this post, we will see the full customized header and customization of the right and left header.

Complete Header Customization using

static navigationOptions = ({ navigation }) => {
    //return header with Custom View which will replace the original header 
    return {
      header: (
        <View
          style={{
            height: 45,
            marginTop: 20,
            backgroundColor: 'red',
            justifyContent: 'center',
          }}>
          <Text
            style={{
              color: 'white',
              textAlign: 'center',
              fontWeight: 'bold',
              fontSize: 18,
            }}>
            This is Custom Header
          </Text>
        </View>
      ),
    };
  };

#how to #stack navigation #react

React Navigation Header Customization in RN using Navigation Options
12.55 GEEK