This week, I finished writing and testing the
getResponsiveValue function. I used this function to set a
sideMenuWidth state. I also used the react-native Dimensions api to check when a device's width changes and update the
sideMenuWidth state using
getResponsiveValue. I set the
openMenuOffset prop on the react-native-side-menu to the
sideMenuWidth state, and I was able to get the side menu to display nicely on mobile and tablet devices. I tested the side menu on an android emulator using mobile and a tablet screen sizes, as well as on a physical android device and the side menu displays nicely.
However, I noticed a bug. When the mobile app starts in landscape mode as opposed to portrait mode, the side menu rendered has a smaller width compared to when the app is started in potrait mode, with the same
openMenuOffset value set.
sideMenuWidth value is the same)
I'm thinking of fixing this by locking the device's orientation to portrait before it's rendered and then unlocking it immediately after, so that the side menu can always display consistently.
Any thoughts on this?
I plan to fix the bug I encountered in the previous week and test what I've done so far.