Open Bort-777 opened 1 year ago
As a temporary workaround (?),
set detachInactiveScreens={false}
for StackNavigator https://reactnavigation.org/docs/stack-navigator/#detachinactivescreens
to prevent this error.
Same issue!
Is there any update for this issue? I have this exact problem
detachInactiveScreens={false} is work
This crash occurs on enable Fabric.
Add this line in your Navigator and fix the problem.
detachInactiveScreens={false}
I'm encountering the same issue aswell.
https://github.com/foyarash/rn-screens-android-crash-tabs
This happens when i have stack navigators inside tab navigator's screens. To get the error, i need to switch tabs exactly 5 times.
This does not happen when I don't use stack navigators as tab screens. And I can confirm that=
detachInactiveScreens={false}
fixes the issue but is not optimal since we want to keep the optimizationI'm encountering the same issue aswell.
https://github.com/foyarash/rn-screens-android-crash-tabs
This happens when i have stack navigators inside tab navigator's screens. To get the error, i need to switch tabs exactly 5 times.
This does not happen when I don't use stack navigators as tab screens. And I can confirm that=
- the issue does not occur on old arch
detachInactiveScreens={false}
fixes the issue but is not optimal since we want to keep the optimization
Adding some detail to this, since I am trying to add some breakpoints into the lib to try finding the cause of the issue.
I noticed a slight difference of behavior in the ScreenContainer.kt onUpdate function.
I am doing the same thing in both old and new arch: switch from TabA to TabB, then TabB to TabA and so on. I added a breakpoint here
What I noticed is that, in the onUpdate
function:
orphaned
HashSet will have 2 elements after the first switch A -> B -> Aorphaned
HashSet will ALWAYS have 0 element.I don't know if that would be the cause of the issue, but I hope this is a first step to find it
@foyarash were you able to deduce anything further in regards to a root cause or better solution?
@cjones26 sadly no, my latest comment on this issue is the most info I could provide. I hope a solution will be found.
Any update on this ? With the new architecture becoming the default with 0.76, this is kind of a big blocker IMO
Description
Hello,
I have experienced an app crash while navigating between bottom tabs multiple times. I have attached the stacktrace and a repro example for reference. The issue may be related to https://github.com/react-navigation/react-navigation/issues/11165. Please take a look and let me know if you could advise.
Thank you.
Steps to reproduce
Snack or a link to a repository
https://github.com/Bort-777/react-native-screens-tabs-repro
Screens version
3.20.0
React Native version
0.71.6
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes