4.0.1
Navigating between tabs without any error
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 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.
Most helpful comment
Any updates here? Having the same issues with 4.0.6
On further debugging in
navigators/createNavigator.jsthis happens after
Actions.replaceadds a new routeStackRouterRootis added torouteswhich is not able to find any associated component and hence it breaks.