question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: There is no route defined for key undefined.

See original GitHub issue

Version

4.0.1

  • react-native-router-flux v4.0.1
  • react v16.2.0
  • react-native v0.52.3

Expected behaviour

Navigating between tabs without any error

Actual behaviour

Error: There is no route defined for key undefined. Must be one of: ‘home’,‘map’,‘restaurant’,‘news’

Here is my Code.

<Router>
<Scene key='root'>
          <Scene key="Login" title="Login Page" hideNavBar={true}  component={LoginPage} navigationBarStyle={{backgroundColor:'#005696'}} titleStyle={{color:'white'}} headerTintColor='#fff'/>
            <Tabs hideNavBar={true} key="tabs" lazy={true} tabs={true} animationEnabled={false} tabStyle={{borderWidth: 1, borderColor: 'rgba(0, 86, 150, 0.3)'}} activeBackgroundColor={'#005696'} labelStyle={{color: '#fff', paddingBottom: 12, fontSize: 15}} tabBarPosition="bottom" tabBarStyle={styles.tabBar}>

                <Scene key="home" initial={true}  hideNavBar={true} title="Home" component={HomeScreen} navigationBarStyle={{backgroundColor:'#005696'}} titleStyle={{color:'white'}} style={{color:'red'}} headerTintColor='#fff'/>

                <Scene key="map" hideNavBar={true} title="Map" component={MapScreen} navigationBarStyle={{backgroundColor:'#005696',}} titleStyle={{color:'white'}} headerTintColor='#fff'/>

                <Scene key="restaurant"  hideNavBar={true} title="Restaurant" component={RestaurantScreen} navigationBarStyle={{backgroundColor:'#005696'}} titleStyle={{color:'white'}} headerTintColor='#fff'/>

                <Scene key="news"  hideNavBar={true} title="News" component={NewsScreen} navigationBarStyle={{backgroundColor:'#005696'}} titleStyle={{color:'white'}} headerTintColor='#fff'/>

            </Tabs>

  </Scene>    
        </Router>

and I am using Actions.replace('restaurant',{ mapdata: newArr}); in Map Tab.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
daviscabralcommented, Sep 12, 2018

Duplicate of #3258.

2reactions
roots-aicommented, Nov 5, 2019

Any updates here? Having the same issues with 4.0.6

On further debugging in navigators/createNavigator.js

this happens after Actions.replace adds a new route StackRouterRoot is added to routes which is not able to find any associated component and hence it breaks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: There is no route defined for key X Must be one ...
I'm trying to make it so that whenever users click the B tab, the B stack resets, so the user is always served...
Read more >
There is no route defined for key navigation.dispatch ... - GitHub
My navigation stack is: App (BottomTabnav) |-HomeTab (Stack navigator) | |-itemList | |-itemDetail |-MyAccountTab (Stack navigator) ...
Read more >
[Solved]-There is no route defined for key auths-React Native
Coding example for the question There is no route defined for key auths-React Native.
Read more >
Navigate to Different Nested Stacks | by Garry ... - Medium
Have your ever encountered an error “Error: There is no route defined for key”? This happens because we navigate to different Nested Stacks....
Read more >
Tutorial: Part 2 – Static POST Handler • Mirage JS
You should see another error: ... POST '/api/reminders', but there was no route defined to handle this request. ... Cannot read property 'id'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found