I'm making app with using React Native with react-navigation.
[My App's hierarchy]
*Drawer(App)
ㄴ StackNavigator
ㄴ StackNavigator
What I want to is fire navigation.navigate('DrawerOpen');
I can show my Drawer by dragging from left edge but it's not triggered by pressing "Menu button" on the left of Navigation header. I've spent so many times to archive this. Please help me.
const Nav = StackNavigator({
mainnav_list:{
screen: (props) => <TodoList {...props} dbCollectionName={props.screenProps.dbCollectionName}/>,
navigationOptions:({navigation}) => ({
headerLeft:(
<TouchableOpacity onPress={() => {console.log(navigation); navigation.navigate('DrawerOpen');}}>
<Text style={{color:'white', marginLeft:15}}>Menu</Text>
</TouchableOpacity>
)
})
},
mainnav_detail:{screen: TodoDetail}
}
,
{
navigationOptions:(props) => ({
title:props.screenProps.dbCollectionName,
headerBackTitle:null,
headerStyle:{backgroundColor:'#000'},
headerTitleStyle:{color:'#fff'},
headerTintColor:'#fff',
})
})
const AppDrawer = DrawerNavigator(
{
drawer1:{screen:() => <Nav screenProps={{dbCollectionName:'todos'}}/> },
drawer2:{screen:() => <Nav screenProps={{dbCollectionName:'todos2'}}/> }
})
AppRegistry.registerComponent('TodosFS', () => AppDrawer);