dioxus/docs/router/examples/history_provider.rs

30 lines
503 B
Rust
Raw Normal View History

2023-06-01 22:31:13 +00:00
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_router::prelude::*;
#[derive(Routable, Clone)]
enum Route {
#[route("/")]
Home {},
}
// ANCHOR: app
#[inline_props]
fn App(cx: Scope) -> Element {
render! {
2023-07-26 01:14:48 +00:00
Router::<Route> {
2023-06-01 22:31:13 +00:00
config: || RouterConfig::default().history(WebHistory::default())
}
}
}
// ANCHOR_END: app
#[inline_props]
fn Home(cx: Scope) -> Element {
render! {
h1 { "Welcome to the Dioxus Blog!" }
}
}
fn main() {}