IllegalStateException in React Native project (Fabric) #2056
Unanswered
luanamarquesf
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @luanamarquesf, in which case does that error happen? What you need to do to reproduce that bug? In our example apps with Fabric enabled, MainActivity doesn't need to override this method (as you can see here - https://github.com/software-mansion/react-native-screens/blob/main/FabricTestExample/android/app/src/main/java/com/fabrictestexample/MainActivity.kt). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I hope you're doing well. I'm reaching out regarding an issue we've encountered in our React Native project.
Problem:
We've recently been receiving the following error in our bug reports:
Environment:
React Native version: 0.73.4
React Native Screens version: 3.29.0
After investigating, I found a potential solution on this GitHub thread. However, the provided solution seems tailored to projects not using RN Fabric. Since our project uses RN Fabric, I couldn't directly apply the suggested fix.
Could anyone provide guidance on how to adapt the solution for RN Fabric? Alternatively, if there's a different approach to address this issue within an RN Fabric setup, I'd greatly appreciate any insights or suggestions.
Thank you for your time and assistance.
Update:
I've created a patch at React native library, at ReactActivity.java file:
This patch overrides the onCreate method to pass a null savedInstanceState, effectively preventing the restoration of screen fragments, which aligns with the solution discussed earlier.
Question: Can anyone confirm if this approach is suitable and if there are any potential drawbacks or considerations to be aware of?
Beta Was this translation helpful? Give feedback.
All reactions