I want to make a sidebar menu like web in react-native. A sidebar can be opened permanently and the main body of application can be accessed when the drawer opens
Asked
Active
Viewed 460 times
0
-
Use flexDirection: "row" and then set the sidebar to "flex: 1" and the rest of content on screen to like "flex: 4" or whatever scale you want. Then only render the sidebar when some variable is true. I assume that variable will then be modified by some toggle button on screen. Also be aware that this will horizontally compress whatever was on the screen which could cause issues with formatting if its not running on like a tablet or something – Matt Oct 09 '19 at 04:26
-
Is this use react-navigation-drawer? – Rizki Fr Oct 11 '19 at 13:22
-
Did you make it work on react-navigation v4? The drawerType permanent is available in V6 – DroidLearner Oct 05 '21 at 12:57
1 Answers
1
To open the drawer permanently drawerType is set to be permanent.
screenOptions={{
drawerType: dimensions.width >= 768 ? 'permanent' : 'front',
}}

mehak saini
- 11
- 3