andylamax

    andylamax

    10 months ago
    how does one handle navigation (specifically routing) in compose-web?
    b

    Brian G

    10 months ago
    Roll your own, or you could try https://github.com/arkivanov/Decompose
    hfhbd

    hfhbd

    10 months ago
    spierce7

    spierce7

    10 months ago
    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
    Big Chungus

    Big Chungus

    9 months ago
    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.
    Arkadii Ivanov

    Arkadii Ivanov

    9 months ago
    @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.
    Big Chungus

    Big Chungus

    9 months ago
    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
    Arkadii Ivanov

    Arkadii Ivanov

    9 months ago
    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?
    Big Chungus

    Big Chungus

    9 months ago
    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 😉
    Arkadii Ivanov

    Arkadii Ivanov

    9 months ago
    Alright, I will check. Thanks.