Skip to content

Support Dynamic Routing

Pre-release
Pre-release
Compare
Choose a tag to compare
@hfhbd hfhbd released this 09 Nov 01:23
· 228 commits to main since this release
73ca5e6

This version allows you to use dynamic routing:

route("foo") {
    if(something) {
        int {
            Text("something $it")
        }
    } 
    noMatch {
        Text("Enable something first")
    }
}

This feature is provided by native @Compose support.
What does it mean? You can now use normal @Compose functions right in your routing code, no more Lazy<Int> and .value usages.
And of course, a header or a footer is now simpler to use as before: directly in the route body.

Also, the function names did change: there is no confusing intRoute and int (parameter), just int.

There is no need for noMatch either, if it is not provided, you don't get an error anymore!

At always, you can try out the sample at: https://routing.softwork.app