Search code examples
react-nativereact-navigation

How to customize headerLeft React Navigation?


How can I customize headerLeft TabNavigator of React Navigation.
Here's one of my screens :

headerLeft

I want to remove the Back from the headerLeft
Is it possible ?
Here's my code :

DetailTabs = TabNavigator({
DetailResult:{
    screen:DetailResult,
    navigationOptions:{
        title:'Detail Penginapan',
        headerTitleStyle:{
            fontSize:14,
            textAlign: "center",
            flex: 1,
        },
        tabBarVisible: false,
        headerStyle:{
            backgroundColor:'#4A94FB',
            borderBottomColor: 'transparent',
        },
        headerTintColor: 'white'
    }
}
})

Solution

  • You probably just need to set headerBackTitle to null. Check out the docs for headerLeft for more info.

    Like this:

    DetailTabs = TabNavigator({
    DetailResult:{
        screen:DetailResult,
        navigationOptions:{
            title:'Detail Penginapan',
            headerTitleStyle:{
                fontSize:14,
                textAlign: "center",
                flex: 1,
            },
            tabBarVisible: false,
            headerStyle:{
                backgroundColor:'#4A94FB',
                borderBottomColor: 'transparent',
            },
            headerTintColor: 'white',
            headerBackTitle: null,
        }
    }
    })