-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
🐛 Bug Report
I was getting crash reports about use of the back button causing crashes on certain screens in my app. In debugging, I came across this PR on the react-native project which seemed to fix the crash facebook/react-native#32989, but I figured it would be good to make a concise reproduction.
In a starter project with only RNN added, I was able to reproduce this by combining the following features:
- Bottom tabs
- Top bar button components
Using one or the other is fine, but the combination of the two leads to a crash when the screen that contains TopBarButtonComponents is 'popped'
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Setup a sample project that reproduces the issue: https://github.com/zzorba/RnnCrashPlayground
- Pressing the Red button and popping the screen works (no crash)
- Pressing the Blue button and popping the screen crashes, at least on the API30 (Android 11.0, Google APIs) emulator that comes with android-studio.
The key difference is the presence of one or more left buttons that are introduced with mergeOptions
when the screen is pushed on.
Expected behavior
Popping the screen would work
Actual Behavior
The app crashes with a callstack about a NullPointerException related to getDisplayCutout
Your Environment
- React Native Navigation version: 7.24.3-hotfix.1
- React Native version: 0.67.1
- Platform(s): Android
- Device info (Simulator/Device? OS version? Debug/Release?): Emulator, API 30, debug. But I have reports of this bug on real devices as well based on callstacks. Based on stack reporting, it does not appear to be an API specific thing, but it doesn't seem to happen on every emulator I have tried (BlueStacks works).
Reproducible Demo
https://github.com/zzorba/RnnCrashPlayground
Are you willing to resolve this issue by submitting a Pull Request?
-✖️ Yes, I have the time, and I know how to start.
- ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
- ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.