0

Just wondering how I can remove the (Back) text in navigation and just use the arrow for navigating I am using react native expo.

 <Stack.Screen
    name="ChatRoom"
    component={ChatRoomScreen}
    options={({route}) => ({
    
      title: route.params.name, 
      
      headerRight: () => (
        <View 
        style={{
          flexDirection: "row",
          width: 100,
          justifyContent: "space-between",
          marginRight: 10,
        }}
      >
     
          <MaterialIcons name="call" size={22} color={'white'} />
          <FontAwesome5 name="video" size={22} color={'white'} />
          <MaterialCommunityIcons name="dots-vertical" size={22} color={'white'}/>
        </View>
      )
    })}
  />

enter image description here

2 Answers 2

1

I found that react navigation behaves weirdly sometimes. But first, you can try this:

headerBackTitle: ' ',

if that makes the back arrow missing, you can add it manually like so:

headerBackImage: ()=> (<Icon name='chevron-left' color='#FFFFF' onPress={()=>{ navigation.goBack();}} />),

you also need to make sure your options has navigation like so:

options={({route, navigation}) => ({

Note: the Icon i used it from react-native-elements.

Sign up to request clarification or add additional context in comments.

Comments

0

You need to

headerBackTitleVisible: false,

add this to options like

options={{
...
headerBackTitleVisible: false,
}}

Proof: https://reactnavigation.org/docs/stack-navigator/#headerbacktitlevisible

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.