Skip to content

Instantly share code, notes, and snippets.

@TheUltDev
Created January 21, 2023 02:20
Show Gist options
  • Save TheUltDev/8ecdc96327571232fb7b3704df364c44 to your computer and use it in GitHub Desktop.
Save TheUltDev/8ecdc96327571232fb7b3704df364c44 to your computer and use it in GitHub Desktop.

DrawerLayout.tsx

import DrawerLayout from 'react-native-gesture-handler/DrawerLayout';
export {DrawerLayout};

DrawerLayout.android.tsx

import {DrawerLayoutAndroid} from 'react-native';
export {DrawerLayoutAndroid as DrawerLayout};

Usage:

import {DrawerLayout} from './DrawerLayout';

<DrawerLayout
  drawerType="front"
  drawerPosition="right"
  renderNavigationView={() => <Menu/>}>
  <View>
    <Text>Rest of your app here</Text>
  </View>
</DrawerLayout>

Docs: https://reactnative.dev/docs/drawerlayoutandroid

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