Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Conditional navigation inside Tabs

export const BottomTabNavigator = () => {
  const [user, setUser] = React.useState(null);

  React.useEffect(() => {
    // check for user
  }, []);
  
  return (
    <Tab.Navigator
      screenOptions={{ ... }}
    >
     <Tab.Screen
        name="LoginRoutes"
        component={user ? UserScreen : LoginScreen}
      />
    </Tab.Navigator>
  );
};
 
PREVIOUS NEXT
Tagged: #Conditional #navigation #Tabs
ADD COMMENT
Topic
Name
7+8 =