how does one handle navigation (specifically routi...
# compose-web
a
how does one handle navigation (specifically routing) in compose-web?
b
Roll your own, or you could try https://github.com/arkivanov/Decompose
h
👍 2
👍🏻 1
s
I highly recommend decompose. I started using it, and it’s a bit different, but once you understand how it works, I prefer it’s explicit no-magic style to something like
👀 2
b
For web, decompose is not a good fit, because it does not manage your url, so you lose any link functionality. I'd recommend using routing-compose, which basically mimics react routers for compose.
a
@Big Chungus I doesn't indeed, but it should be possible to manage urls manually. This should be a one-time job. And Decompose supports deep links as well.
b
If decompose is pluggable in this regard, it would be great to have js-only module to allow registering this behaviour on jsMain, but still having all your decompose code in commonMain
a
Yeah, I will consider this. Am I right that on navigation the page is reloaded with another URL? Or should the URL in the browser just change, following the navigation?
b
It should go both ways. If i change the path in url, router should react and likewise it should provide some @Composable to act as a link element, that when clicked notifies the router to change url
Have a look at how it's done in router-compose for ideas ;)
a
Alright, I will check. Thanks.