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

React Native: Navigate to new page without tabs?

$
0
0

So what I want to do is very simple, but i'm not sure how to do it.

1) I have tabs on my main page.

2) The tabs pages have buttons that take me to a new page when pressed.

3) On that new page, the old tabs from my main page are still showing up. I DON'T want this to happen.

Code for creating the tabs:

  render() {
    const Tab = createMaterialTopTabNavigator();

    return (
      <Tab.Navigator tabBarOptions={{}}>
        <Tab.Screen name="Profile" component={Profile} />
        <Tab.Screen name="Swipe" component={SwipePage} />
        <Tab.Screen name="Messages" component={FemaleMessages} />
      </Tab.Navigator>
    );
  }

Stack Navigator for taking me to the next page:

    const Stack = createStackNavigator();
    return (
      <Stack.Navigator>
        <Stack.Screen
          name="Main"
          component={test}
          options={{
            headerTransparent: true,
            headerTitle: '',
            headerLeft: null,
          }}
        />
        <Stack.Screen
          name="Settings"
          component={Settings}
          options={{
            headerTransparent: true,
            headerTitle: '',
            headerBackTitle: 'Home',
          }}
        />
...
)

And the button for taking me to the new page: (Tried "replace", "navigate", "push")

<TouchableOpacity
          style={{marginLeft: 20, marginRight: 20}}
          onPress={() =>
            navigation.replace('Settings', {tabBarVisible: false})
          }>
          <Image
            source={require('../images/close.png')}
            style={{width: 40, height: 40}}></Image>
        </TouchableOpacity>

Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>