YASAN
12/09/2021, 4:56 PMView
variable inside a shared ViewModel which lives with in the app scope and not inside a specific route. I use this view inside one of my routes. My issue is that if the screen is rotated or the route is navigated to again from itself, loading the view throws an exception since the view is still attached to the previous layout parent.
I know the fix for this is to have at least 2 instances of the view I need but the issue is that composable lifecycles work a bit weirdly and I cannot figure out exactly how and when I should tell the ViewModel to switch the used view so it wont throw an exception.
More in 🧵Chris Fillmore
12/09/2021, 5:14 PMYASAN
12/09/2021, 5:24 PM