-1
am trying to implement a Drawer in my app. As I want only in one of my screens. While trying to implement, I felt some difficulties. So I did step by step not to get lost.
I created a button and I want to do Drawer open up when he goes clicked, but nothing is returning to me.
Follow the code below:
import React from 'react';
import { View, Button} from 'react-native';
import { createAppContainer, DrawerNavigator } from 'react-navigation';
import { createDrawerNavigator, DrawerActions } from 'react-navigation-drawer';
import TabsNav from './TabsLeadScreen';
const AppNavigator = createDrawerNavigator({
Contact: {
screen: TabsNav
},
Teste: {
screen: TabsNav
}
}, {});
const DrawerCustom = createAppContainer(AppNavigator);
function ShowScreen({ navigation }) {
return (
<View>
<Button title="abrir" onPress={() => navigation.dispatch(DrawerActions.openDrawer())} />
<DrawerCustom />
</View>
);
}
I’m using the
-React-navigation: ^4.0.10
-expo: ~37.0.3
Could someone help me?
Thank you!
Iae, use this link as an example. Any questions just comment https://answall.com/a/446384/160305
– Ruan Duarte
Oops, so I insert a template like yours, but when I give an onclick on the button to open, it keeps happening nothing... Ai insert a console.log to see the return of it, is returning false
estou passando esse código navigation.dispatch(DrawerActions.openDrawer())
– Nathan