t1m0t 8ad3f85872 fix ordering to match original one hace 3 años
..
.vscode cb2782b4bb wip: memoize dom in the prescence of identical components hace 3 años
examples cb2782b4bb wip: memoize dom in the prescence of identical components hace 3 años
src 3509602c0b Merge pull request #169 from DioxusLabs/jk/router-userouter hace 3 años
tests d7968c987f wip: Makefile setup hace 3 años
CHANGELOG.md 56f3002aed feat: add changelogs hace 3 años
Cargo.toml 8ad3f85872 fix ordering to match original one hace 3 años
Makefile.toml d7968c987f wip: Makefile setup hace 3 años
README.md 29ed7ebece feat: connect an onchange listener hace 3 años

README.md

Routing for Dioxus App

DioxusRouter adds React-Router style routing to your Dioxus apps. Works in browser, SSR, and natively.

fn app() {
    cx.render(rsx! {
        Router {
            Route { to: "/", Component {} },
            Route { to: "/blog", Blog {} },
            Route { to: "/blog/:id", BlogPost {} },
        }
    })
}

Then, in your route, you can choose to parse the Route any way you want through use_route.

let id: usize = use_route(&cx).segment("id")?;

let state: CustomState = use_route(&cx).parse()?;

Adding links into your app:

Link { to: "id/{id}" }

Currently, the router is only supported in a web environment, but we plan to add 1st-party support via the context API when new renderers are available.