Ask Your Question
4

What is the method to keep the react navigation drawer open at all times?

asked 2023-07-15 08:18:15 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-15 08:39:02 +0000

qstack gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-15 08:18:15 +0000

Seen: 13 times

Last updated: Jul 15 '23