Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To keep the React Navigation Drawer open at all times, you can set the drawerLockMode prop to 'locked-open' in the DrawerNavigatorConfig object. This will disable the ability to close the drawer and keep it open permanently.

Here is an example code snippet:

import { createDrawerNavigator } from '@react-navigation/drawer';

const Drawer = createDrawerNavigator();

function MyDrawer() {
  return (
    <Drawer.Navigator
      drawerLockMode={'locked-open'}
    >
      {/* your screens here */}
    </Drawer.Navigator>
  );
}

Note: It's usually not recommended to keep the drawer permanently open as it takes up valuable screen space for the main content.