Search code examples
androidreact-nativedrawerlayout

TouchableHighlight on DrawerLayoutAndroid


I'm using DrawerLayourAndroid. I want to navigate to another View by TouchableHighlight in DrawerLayout. Here's my code for DrawableLayout:

var drawerLayout = (
  <View>
    <TouchableHighlight onPress=
      {()=>this.props.navigator.push({name:'secView', component:secView})}>
      <Text>move</Text>
    </TouchableHighlight>
  </View>
);

But it has the error "undefined is not an object (evaluating '_this.props.navigator')". How can I make it work?


Solution

  • I used react-native's Navigator when I posted this post. And I solved this problem by using react-native-router-flux at here. https://github.com/aksonov/react-native-router-flux

    I used Actions.name(params) in my custom drawer, and it works!