Skip to content

Instantly share code, notes, and snippets.

@kevinold
Last active October 3, 2021 20:34
Show Gist options
  • Save kevinold/fefd93803ebe4b023158e47655990fa0 to your computer and use it in GitHub Desktop.
Save kevinold/fefd93803ebe4b023158e47655990fa0 to your computer and use it in GitHub Desktop.
Left and Right Drawers with React Navigation
import React, { Component } from 'react';
import { Text } from 'react-native';
import { DrawerNavigator } from 'react-navigation';
const ContentScreen = ({ navigation }) => (
<Text>Content Hello World</Text>
);
const LeftDrawerScreen = ({ navigation }) => (
<Text>Left Drawer</Text>
);
const RightDrawerScreen = ({ navigation }) => (
<Text>Right Drawer</Text>
);
const ContentNavigator = DrawerNavigator({
Content: {
screen: ContentScreen,
}
}, {
contentComponent: RightDrawerScreen,
drawerPosition: 'right'
});
const RootNavigator = DrawerNavigator({
Child: {
screen: ContentNavigator,
}
}, {
contentComponent: LeftDrawerScreen
});
export default class App extends Component {
render() {
return (<RootNavigator />);
}
}
@emadbaqeri
Copy link

I have solved the problem by using react-native-reanimated and an overlay View on the top of other components :). I thought this is going to put me in trouble while I'm going to have a deep nested navigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment