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

180
Views
React The action 'NAVIGATE' with payload {"name":""} was not handled by any navigator

I am trying to route my user

const tryLogin = async () => {
    try {
      await firebase.auth().onAuthStateChanged((user) => {
        if (user != null) {
          
          props.navigation.navigate("Page1");
        } else {
          props.navigation.navigate("Page3");
        }
      });
    } catch {
      console.log("errrors");
    }
  };

My navigation looks like this

    <NavigationContainer>
      <Drawer.Navigator>
        {userToken == null ? (
          <>
            <Drawer.Screen
              name="Splash"
              component={SplashScreen}
              options={{ headerShown: false }}
            />
            <Drawer.Screen name="Page1" component={Page1} options={{}} />
            <Drawer.Screen name="Page2" component={Page2} options={{}} />
          </>
        ) : (
          <>
            <Drawer.Screen name="Page3" component={Page3} options={{}} />
            <Drawer.Screen name="Page4" component={Page4} />
            <Drawer.Screen name="Page5" component={Page5} />
            <Drawer.Screen name="Page6" component={Page6} />
            <Drawer.Screen name="Page7" component={Page7} />
          </>
        )}
      </Drawer.Navigator>
    </NavigationContainer>

It works perfectly fine with page 1&2 component but as I try to redirect to page3 component I get following error The action 'NAVIGATE' with payload {"name":"Page3"} was not handled by any navigator.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You are mixing async and promises function in your code.

You should check for the userToken condition also in the code that triggers the navigate Action.
Based on your logic, if the userToken exists, the Page3 component is not rendered.
This is the reason for the error.

Try to change your code like this:

const tryLogin = async () => {
  try {
    const user = await firebase.auth().onAuthStateChanged();

    if (user !== null) {
      props.navigation.navigate('Page1');
    } else if (userToken !== null) {
      props.navigation.navigate('Page3');
    }
  } catch {
    console.log('errrors');
  }
};
about 4 years ago · Juan Pablo Isaza 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!