0
I performed the configuration of Drawernavigator on with the React-navigation 3.x, it seems the code is correct, but it just doesn’t work, so I swipe the finger through the screen it just doesn’t come. Follow below the codes:
Construction of the Drawernavigator
import React from 'react'
import { Platform, Dimensions } from 'react-native'
import { createDrawerNavigator, createAppContainer } from 'react-navigation';
import Home from './screens/Home';
import Page1 from './screens/Page1';
import Page2 from './screens/Page2'
const WIDTH = Dimensions.get('window').width
const drawerConfig = {
drawerWidth: WIDTH * 0.83,
}
const Navigator = createDrawerNavigator({
Home: {
screen: Home
}
}, drawerConfig);
export default createAppContainer(Navigator)
Call from Drawernavigator in the application:
import React, { Component } from 'react'
import { StyleSheet, Text, View } from 'react-native'
import Navigator from './src/Navigator'
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Navigator />
</View>
);
};
}
const styles = new StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff'
},
})
The React Navigation installation manual explains the need for the installation of Gesture-Handler. https://reactnavigation.org/docs/en/getting-started.html
– sant0will