Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

React Native: Remove a back button from navigation stack?

$
0
0

So I have a navigation stack that constantly adds pages to it. The user can go to the previous page, or the next page. Like a sign up page.

So for example, here is a page with 3 screens (previous page, current page, next page)

function MyStack() {
  const Stack = createStackNavigator();
  return (
    <Stack.Navigator>
      <Stack.Screen
        name="Current"
        component={ContentFunction}
        options={{headerTransparent: true, headerTitle: ''}}
      />
      <Stack.Screen name="Back" component={BackFunction} />
      <Stack.Screen
        name="Next"
        component={FirstNamePage}
        options={{
          headerTransparent: true,
          headerTitle: '',
          headerBackTitle: 'Gender',
        }}
      />
    </Stack.Navigator>
  );
}

The problem is, the buttons are piling on top of each other. See below.

enter image description here

What I need is to delete the old button, but I don't know how to do that. Of course I could do it with setting:

<Stack.Screen
        name="Next"
        component={FirstNamePage}
        options={{
          headerLeft: null
        }}
      />

But I cannot do this unless I am on that specific function. How do I go about doing this?


Viewing all articles
Browse latest Browse all 16552

Trending Articles