Android ComposeView, Composable is gone upon returning to Screen from stack #2098
Labels
Missing repro
This issue need minimum repro scenario
Platform: Android
This issue is specific to Android
Description
tldr; Jetpack ComposeViews do not maintain state or recompose upon returning to a Screen with a ComposeView driving a component of the Screen.
Suppose you have three screens, screens A, B and C
Screen B has a View that links to a
ComposeView(..)
from AndroidNavigating to Screen C, then returning to Screen B, the ComposeView driven component is gone
According to this issue tracker, https://issuetracker.google.com/issues/284424175, the issue lies within how ScreenFragment recycles the views
https://github.com/software-mansion/react-native-screens/blob/main/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt#L307-L321
react-native-community/discussions-and-proposals#446 (comment)
Project to repro (thanks to @thevoiceless) - https://github.com/thevoiceless/RN-Compose-Playground
problematic-compose-view.mov
Steps to reproduce
Snack or a link to a repository
https://github.com/thevoiceless/RN-Compose-Playground
Screens version
3.21.0
React Native version
0.73.5
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: