Whats the recommended way to do Navigation on comp...
# compose-desktop
s
Whats the recommended way to do Navigation on compose desktop? It seems the official one mentioned in compose doc (https://developer.android.com/jetpack/compose/navigation) is not implemented.
s
I’m in the process of trying out Decmpose, which they use in their todo example app - https://github.com/arkivanov/Decompose
s
Compose has a navigation library, then why we need to use a third party one? Also, the compose navigation looks more simpler.
a
Decompose
is a bit more than just navigation. It also provides Lifecycle, state preservation, ability to retain instances over configuration changes, etc. Here is an article about it. Decompose components are like Fragments (or BLoCs). My own opinion - we should use Compose for dumb simple UI, and navigation and business logic should be kept outside of UI. That's why Decompose. 🙃
One of the benefits of such approach is that we already can write business and navigation logic shared between Android/JVM/Native/JS. And just plug different UI: Compose for Android and JVM, SwiftUI for iOS, React for JS, etc.
s
Android/JVM/Native/JS.
Agreed. What i was suggesting is, there should be something builtin (which is already part of compose, but not available on desktop) for simpler use cases and if you want to go for full MPP, use decompose for advanced scenarios. Not everybody is doing MPP and my use case right now is just desktop.
👍 2
415 Views