Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: There is no route defined for key undefined. #3259

Closed
arghyaExicube opened this issue Sep 12, 2018 · 7 comments
Closed

Error: There is no route defined for key undefined. #3259

arghyaExicube opened this issue Sep 12, 2018 · 7 comments

Comments

@arghyaExicube
Copy link

arghyaExicube commented Sep 12, 2018

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.

@daviscabral
Copy link
Collaborator

Duplicate of #3258.

@arghyaExicube
Copy link
Author

Is there any solution for now to naviagte between tabs with props?

@daviscabral
Copy link
Collaborator

@Arghya95 while I check a permanent solution - could you try:

Actions.replace('restaurant',{ mapdata: newArr}, 'tabs');

@arghyaExicube
Copy link
Author

arghyaExicube commented Sep 14, 2018

@daviscabral No, It's generating the same error.
Can I solve this by downgrading the version?
If yes, which version?

@daviscabral
Copy link
Collaborator

Have you tested with other keys? Like:

  Actions.replace('restaurant', { mapdata: newArr}, 'Login');

Please, check if the same structure from the Example app might fix it for you. With the Example we have props working with the master version.

@wiliam-toney
Copy link

Is this issue is resolved? I am having the same problem with version 4.0.6

@roots-ai
Copy link

roots-ai commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants