Changing screen orientation breaks layout
Reproduction link: https://github.com/artiekra/react-native-bug-mre
When forcing landscape orientation on one of the views, and then going back, actual element layout is different from whats rendered on the screen, causing buttons and other to stop working.
Steps to reproduce the behavior:
- Start the attached app with
npm run dev - Click through to the last view ("Continue", then "Play")
- Go back with the back button
- "Play" button stops reliably working
- If it still works, try going back one more time, and you should see "Continue" button not working
Expected behavior Going forward and back with the buttons not changing their behaviour
Screenshots
https://github.com/user-attachments/assets/acffff57-4a81-4176-ab93-cd92ff98a2b0
Platform:
- Type: Device
- OS: Android 16
Additional context I have tried replacing React Native Reusables components with simpler ones (see working branch of my repo: https://github.com/artiekra/react-native-bug-mre/tree/working), and the bug stopped occuring, thus I'm reporting it here. I have tried other ways to fix the bug (waiting before switching landscape mode, using native screen options instead of expo-screen-orientation, specifying both "default" and "portrait" default modes in both app config and app itself, forcing portrait mode on all portrait screens, etc) - but nothing fixed the issue apart from not using React Native Reusables
Source: founded-labs/react-native-reusables