My understanding is that `@Compose` does not suppo...
# compose
z
My understanding is that
@Compose
does not support backstack handling automatically, like
FragmentManager
does, and that we would be forced to track backstack behavior ourselves in business logic (which makes more sense, as it’s just so flexible). Assuming I’m correct about this, is there any documentation or information anywhere that advocates managing backstack logic ourselves in a
@Compose
world? Like representing a backstack like
listOf(screen1, screen2)
? I’m looking to share this info with colleagues rather than argue for it myself haha
p
I think I’ve seen mentions of a project called compose-router here, but also AndroidX Navigation will support Compose eventually. I’m building on a pretty normal Activity + Fragments stack using AndroidX Navigation with Compose for each Fragment/Activity. So it’s still possible to take advantage of the existing mechanisms.
z
yeah, I’m talking about a
@Compose
world without
Fragment
i
AndroidX Navigation is indeed coming to Compose in ~weeks. After that, you'd certainly be able to use that in a pure Compose world or write your own thing like you have to do now
🎉 23
z
If you just want to manage the backstack yourself, https://github.com/zach-klippenstein/compose-backstack might be helpful. It’s just a composable function that takes a list of “screen” values (the backstack) and a composable function to render a screen. It does basic transition animations and UI state save/restoration for you.
👍 3
r