How to Make the Navigation Drawer In React Native slide from the right Side, I tried position: right but it doesnt work
export default createDrawerNavigator({
Home:{
screen: AppStackNav,
navigationOptions: {
drawerIcon: ({tintColor}) => (
<Icon name = 'ios-home' style={{fontSize:24, color: tintColor}}/>
),
drawerLabel: "Home",
}},
Setting: {
screen: SettingScreen,
navigationOptions: {
drawerLabel: "Setting",
drawerIcon: ({tintColor}) => (
<Icon name = 'ios-settings' style={{fontSize:24, color: tintColor}}/>
)}},
{
contentComponent: CustomDrawerComponent
},{
drawerPosition: 'right',}
);
You need to add drawerPosition: 'right' inside screenOptions tag. like This <Drawer.Navigator
initialRouteName="HomeScreen"
screenOptions={{ headerShown: false, drawerPosition:"right" }}}>
</Drawer.Navigator>
Closing bracket of component was missing and drawerPosition should be the first parameter after closing bracket of component. Works fine now.
const Hello = createDrawerNavigator({
Home:{
screen: AppStackNav,
navigationOptions: {
drawerIcon: ({tintColor}) => (
<Icon name = 'ios-home' style={{fontSize:24, color: tintColor}}/>
),
drawerLabel: "Home",
}},
Setting: {
screen: SettingScreen,
navigationOptions: {
drawerLabel: "Setting",
drawerIcon: ({tintColor}) => (
<Icon name = 'ios-settings' style={{fontSize:24, color: tintColor}}/>
)}}
},{
drawerPosition: 'right',},
{
contentComponent: CustomDrawerComponent
}
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With