does anyone here use the Voyager library for navig...
# multiplatform
b
does anyone here use the Voyager library for navigation, and what are your impressions?
m
I do. Decided for it since it’s the most simple API-wise. It provides nice Android like ScreenModels (ViewModels) which have directly an auto-canceled coroutine scope. For basic navigation it’s fine (thx to the author for the nice work!). I had some problems with more complex setups like auth flow and nested Navigators. So if you just need one top level navigator it will work, for nested ones you need to check if it works. Animation wise i hope swipe-back will be implemented in the future. But again: since the api is so nice clean (nearly no overhead over pure-compose), it will be easy to switch in the future to the official Jetbrains solution, in case it’s good.
🙌 2
b
thank you! Sounds like it is just what I needed.
j
+1 for liking Voyager 🙂 Easy to use + solid behaviour.
v
@Max I guess you also faced the issue that nested navigators in the Tabs are not cleared (ScreenModels) when you try to logout user via likely
navigator.replace(Login())
and then when you return into Main() the old nested viewmodels are picked from the store again? Did you find an elegant solution for the issue?
m
@Vlad My issue was that even though navigation wise the nested TabNavigator kind of worked, on iOS as soon as i gave focus to a TextInput, the Composable crashed and the TabNavigator re-initialised. So TextInputs were not useable on iOS. Which was a dealbreaker. What i do now, I handle the main navigation (Splash/Auth/LoggedIn) via pure-Compose - no Voyager. Auth and LoggedIn are each one a Navigator (Auth normal one, LoggedIn a tab).
v
Then we have faced very different issues because of the nested navigators
m
FYI: I followed this code recommendation here: https://github.com/adrielcafe/voyager/issues/370#issuecomment-2004696427 This
CurrentScreen()
was the problematic part