React-native-router-flux: Error: There is no route defined for key undefined.

Created on 12 Sep 2018  路  7Comments  路  Source: aksonov/react-native-router-flux

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.

duplicate

Most helpful comment

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.

All 7 comments

Duplicate of #3258.

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

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

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

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

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.

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgibbons picture jgibbons  路  3Comments

willmcclellan picture willmcclellan  路  3Comments

VictorK1902 picture VictorK1902  路  3Comments

basdvries picture basdvries  路  3Comments

tonypeng picture tonypeng  路  3Comments