Skip to content

Changing screen orientation breaks layout #545

Description

@artiekra

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:

  1. Start the attached app with npm run dev
  2. Click through to the last view ("Continue", then "Play")
  3. Go back with the back button
  4. "Play" button stops reliably working
  5. 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

react.mp4

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions