Tell us which versions you are using:
undefined is not an object (evaluating 'route.routeName') !!?
My App.js is simple and it is a fresh react native installation only with router flux, and error happens when i use contentComponent in Drawer
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View} from 'react-native';
import {Router , Scene } from 'react-native-router-flux';
import Home from './src/components/Home';
import About from './src/components/About';
import SideMenu from './src/components/SideMenu';
import splashScreen from './src/components/splashScreen';
export default class App extends Component {
render() {
return (
<Router>
<scene hideNavBar>
<Scene key="root">
<Scene key="drawer" drawer contentComponent={SideMenu}>
<Scene key="Home" component={Home} title="HomePage" initial/>
<Scene key="About" component={About} title="Second Page"/>
</Scene>
</Scene>
</scene>
</Router>
);
}
}
it made me crazy !! any one has facing this issue !!?
You've got a typo in your code (you wrote scene with a lowercase S at a point.
Still, it's a duplicate of #2718 and it looks like the error is from react-navigation.
I have the same issue with this code:-
react-native-router-flux: 4.0.0-beta.22
react-native: 0.49.3
<Router
backAndroidHandler={() => Actions.pop()}
sceneStyle={styles.sceneStyle}
>
<Scene key="root">
<Scene
key="scene1"
component={Scene1}
title="Scene 1"
navigationBarStyle={styles.navigationBarStyle}
navBarButtonColor={styles.navBarButtonColor}
titleStyle={styles.titleStyle}
initial
/>
<Drawer
hideNavBar
key="dashboard"
drawerImage={Images.menuIcon}
contentComponent={Navigation}
drawerWidth={styles.drawerWidth}
>
<Scene
key="dashboard"
component={Dashboard}
title={strings.dashboard}
navigationBarStyle={styles.navigationBarStyle}
navBarButtonColor={styles.navBarButtonColor}
titleStyle={styles.titleStyle}
renderRightButton={renderNotificationButton}
/>
</Drawer>
</Scene>
</Router>
try this drawer component
key='drawer'
contentComponent={DrawerContent}
drawerWidth={250}
drawerOpenRoute = 'DrawerOpen' //maybe these 3 are missing so the problem
drawerCloseRoute = 'DrawerClose'
drawerToggleRoute = 'DrawerToggle'>
@vibhavagarwal5 thanks,it works for me.is it a bug or?
Its not a bug @AKMaS but a lack of documentation in this repo and in the example given!
Most helpful comment
try this drawer component
hideNavBar
key='drawer'
contentComponent={DrawerContent}
drawerWidth={250}
drawerOpenRoute = 'DrawerOpen' //maybe these 3 are missing so the problem
drawerCloseRoute = 'DrawerClose'
drawerToggleRoute = 'DrawerToggle'>