Has anyone tried to use navigation in compose mult...
# compose
j
Has anyone tried to use navigation in compose multiplatform? I looked it up and it is recommend to use Voyager or decompose, however if I add it in the gradle build file it isn't recognised
a
I have worked with Decompose, and it works perfectly fine
j
Does it also have wasm support? I tried using Voyager which doesn't really work:/ thx for the fast reply
a
I never tried with wasm, but as per the doc it supports wasmJs
How good the support is, you need to explore that
👍 1
j
Will do, thanks a lot!
1
a
Decompose supports Wasm for Browser since version 3.0.0-alpha01.
🎉 2
s
Voyager, hopefully we will have a version in two weeks with WASM support.
👍 3
m
@Anum Amin yeah, as someone who is currently looking into both voyager and decompose, my only concern about voyager is there seems to be very little noise surrounding it, and also not much in the way of support.
a
I am not sure if it's true. But Voyager is meant for compose multiplatform only, while Decompose supports both native UIs and compose multiplatform.
👌 2
m
Hmm, interesting. Any examples of what native Android UI functionality Voyager does not support?
a
Its about multiplatform navigation support rather than native android UI. Also, since I never explored Voyager myself, therefore I will not be able to answer it
a
I think this is because with Voyager we directly override a Composable function in screen classes. In this case I think we can't use e.g. React on Web, or SwiftUI on iOS with its native navigation gestures (aka NavigationStack).
☝️ 1
s
Voyager uses the Compose composition to do all the navigation events, we have a StateStack (similar to StateList of Compose), that each changes, recompose where is being used inside a @Composable.
m
This is all very interesting. I’m looking for reasons to choose Voyager or Decompose. My app is currently Android-only with a view to using KMP further down the line. Any examples of what native Android UI functionality Voyager does not support?
a
Voyager supports only Compose UI, plus you should be able to insert Android views via
AndroidView
.
There are also other criteria to choose one or the other: different API, different feature set, etc.
m
Hmm, I’m already at the point where my entire Android UI is in Compose, so that part isn’t an issue at least.
a
In this case I would check both libs and choose the one that suits my needs more. 🙂 Plus there is also Decompose-Router, which is kinda a simplified compose-first version of Decompose.
253 Views