docs: update local examples and docs to support new syntaxes
This commit is contained in:
1 parent
e495b09bf1
commit
4de16c4779
118 files changed
+520
-1154
No files matched your search
@@ -6,10 +6,10 @@ use dioxus_router::*;
|
||||
fn main() {
|
||||
console_error_panic_hook::set_once();
|
||||
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
||||
dioxus_web::launch(App, |c| c);
|
||||
dioxus_web::launch(APP);
|
||||
}
|
||||
|
||||
static App: Component<()> = |cx, props| {
|
||||
static APP: Component<()> = |cx| {
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
enum Route {
|
||||
Home,
|
||||
@@ -17,7 +17,7 @@ static App: Component<()> = |cx, props| {
|
||||
NotFound,
|
||||
}
|
||||
|
||||
let route = use_router(cx, |s| match s {
|
||||
let route = use_router(&cx, |s| match s {
|
||||
"/" => Route::Home,
|
||||
"/about" => Route::About,
|
||||
_ => Route::NotFound,
|
||||
|
||||
Reference in new issue
Block a user