Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
React Native: trying to Pass Stack Navigation into Bottom tab Navigation

Im having trouble trying to pass in my Stack Navigator to my Bottom Tab Navigator. I keep getting the error below. Where am I going wrong?

I created the Stack navigation component and then imported it into my bottom tab navigation and then passed the component into there. I think everything is right but then the error begins

enter image description here

BOTTOM TAB NAVIGATOR


import * as React from 'react';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { LeftNavigator } from '../stack.navigation.js/stack';


const Tab = createMaterialBottomTabNavigator();

export const BottomNavigator = () => {
 return (
     <>
 <Tab.Navigator initialRouteName="Left" activeColor="white" >
          
        <Tab.Screen name="Left Screen" component={LeftNavigator} />

       //here im trying to pass in my stack navigator component to my bottom tab navigator 
          
 </Tab.Navigator>   
     </>
 )
}


STACK NAVIGATOR


import * as React from 'react';
import { CnnScreen } from '../news.screens.js/cnn';
import  { Reuters } from '../news.screens.js/reuters';
import   { TheVerge } from '../news.screens.js/the.verge'
import { StyleSheet, Text, SafeAreaView, ScrollView, View, Image, TouchableOpacity} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { LeftScreen } from '../left/left.screen';

import { createNativeStackNavigator } from '@react-navigation/native-stack';


const LeftStack = createNativeStackNavigator();

export const LeftNavigator = () => {
    
  <LeftStack.Navigator initialRouteName='Left'>
        <LeftStack.Screen name="Left" component={LeftScreen}/>
        <LeftStack.Screen name="CNN" component={CnnScreen}/>
        <LeftStack.Screen name="Reuters" component={Reuters}/>
        <LeftStack.Screen name="TheVerge" component={TheVerge}/>
  </LeftStack.Navigator>    

}

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You have two problem in your code.
first code need to fix:
[BOTTOM TAB NAVIGATOR]

 ...
    const Tab = createMaterialBottomTabNavigator();
    
    export const BottomNavigator = () => {
     return (
         <>                                 
                                            |
                                            |
                                            |
                                            *
  ---->   <Tab.Navigator initialRouteName="Left" activeColor="white" >
 replace it to: "Left Screen" as your tab screen name
              
     <Tab.Screen name="Left Screen" component={LeftNavigator} />
    
           //here im trying to pass in my stack navigator component to my bottom tab navigator 
              
     </Tab.Navigator>   
         </>
     )
    }

second:
STACK NAVIGATOR

    ....
    const LeftStack = createNativeStackNavigator();
    
    export const LeftNavigator = () => {

     //---> Add return     
return <LeftStack.Navigator initialRouteName='Left'>
            <LeftStack.Screen name="Left" component={LeftScreen}/>
            <LeftStack.Screen name="CNN" component={CnnScreen}/>
            <LeftStack.Screen name="Reuters" component={Reuters}/>
            <LeftStack.Screen name="TheVerge" component={TheVerge}/>
      </LeftStack.Navigator>    
}
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!