react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

fix: iOS screen orientation crash

Open henninghall opened this issue 3 years ago • 1 comments

Description

This change in PR https://github.com/software-mansion/react-native-screens/pull/863 introduces a crash in some situtations.

In our case, we are not providing an orientation to the "react-native-screen"-screen and instead we are changing the orientation manually. There are probably several situations where you want to be able to do that.

Changes

Restored the functionality by returning UIInterfaceOrientationMaskAllButUpsideDown in cases where orientation is not provided to the screen.

Test code and steps to reproduce

Checklist

  • [ ] Included code example that can be used to test this change
  • [x] Updated TS types
  • [x] Updated documentation:
    • [x] https://github.com/software-mansion/react-native-screens/blob/master/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
    • [x] https://github.com/software-mansion/react-native-screens/blob/master/native-stack/README.md
    • [x] https://github.com/software-mansion/react-native-screens/blob/master/createNativeStackNavigator/README.md
    • [x] https://github.com/software-mansion/react-native-screens/blob/master/src/types.tsx
    • [x] https://github.com/software-mansion/react-native-screens/blob/master/src/native-stack/types.tsx
  • [x] Ensured that CI passes

henninghall avatar Aug 19 '21 08:08 henninghall

Can you provide a repo with reproduction of the crash? Isn't the default value of the orientation UIInterfaceOrientationMaskAllButUpsideDown? Also, if you do not provide screenOrientation on any of the screens, I think it shouldn't ever enter that if clause, so the reproduction would be even more valuable.

WoLewicki avatar Aug 19 '21 09:08 WoLewicki