Hi @arkivanov. I think #59 broke the router for both iOS and the Web targets. I was able to pinpoint the issue down to how the Values are subscribed as State in this extension function
private fun <T : Any> Value<T>.asState(lifecycle: Lifecycle): State<T> {
val state = mutableStateOf(value)
observe(lifecycle = lifecycle) { state.value = it }
return state
}
This works for both Android and Desktop, but not on iOS and Web for some unknown reason.
For now, I was able to fix it temporarily with expect/actual for ios and web to fall back to the previous approach with subscribeAsAState. But this still introduces the issue of the nested router failing to navigate upon returning back.
Hi @arkivanov. I think #59 broke the router for both iOS and the Web targets. I was able to pinpoint the issue down to how the
Value
s are subscribed asState
in this extension functionThis works for both Android and Desktop, but not on iOS and Web for some unknown reason.
For now, I was able to fix it temporarily with
expect
/actual
for ios and web to fall back to the previous approach withsubscribeAsAState
. But this still introduces the issue of the nested router failing to navigate upon returning back.Before
https://github.com/xxfast/Decompose-Router/assets/13775137/4527a42b-1c93-4e47-a9b9-bfbebbce79de
After
https://github.com/xxfast/Decompose-Router/assets/13775137/2b0f8cde-eb18-4f9d-be0c-8913eaf80771
This PR will
expect
/actual