get cargo check --all --examples --tests working!

This commit is contained in:
Jonathan Kelley committed 2024-01-19 15:01:01 -08:00
1 parent 83bce6ce97
commit 337c04557b
18 files changed
+109 -508

No files matched your search

+8 -23
View File
@@ -5,7 +5,7 @@ use dioxus_router::prelude::*;
fn prepare(path: impl Into<String>) -> VirtualDom {
let mut vdom = VirtualDom::new_with_props(App, AppProps { path: path.into() });
let _ = vdom.rebuild();
vdom.rebuild_in_place();
return vdom;
#[derive(Routable, Clone)]
@@ -29,18 +29,13 @@ fn prepare(path: impl Into<String>) -> VirtualDom {
ParameterFixed { id: u8 },
}
#[derive(Debug, Props, PartialEq)]
struct AppProps {
path: String,
}
#[component]
fn App(cx: Scope<AppProps>) -> Element {
fn App(path: String) -> Element {
rsx! {
h1 { "App" }
Router::<Route> {
config: {
let path = cx.props.path.parse().unwrap();
let path = path.parse().unwrap();
move || RouterConfig::default().history(MemoryHistory::with_initial_path(path))
}
}
@@ -49,9 +44,7 @@ fn prepare(path: impl Into<String>) -> VirtualDom {
#[component]
fn RootIndex() -> Element {
rsx! {
h2 { "Root Index" }
}
rsx! { h2 { "Root Index" } }
}
#[component]
@@ -64,16 +57,12 @@ fn prepare(path: impl Into<String>) -> VirtualDom {
#[component]
fn FixedIndex() -> Element {
rsx! {
h3 { "Fixed - Index" }
}
rsx! { h3 { "Fixed - Index" } }
}
#[component]
fn FixedFixed() -> Element {
rsx! {
h3 { "Fixed - Fixed"}
}
rsx! { h3 { "Fixed - Fixed"} }
}
#[component]
@@ -86,16 +75,12 @@ fn prepare(path: impl Into<String>) -> VirtualDom {
#[component]
fn ParameterIndex(id: u8) -> Element {
rsx! {
h3 { "Parameter - Index" }
}
rsx! { h3 { "Parameter - Index" } }
}
#[component]
fn ParameterFixed(id: u8) -> Element {
rsx! {
h3 { "Parameter - Fixed" }
}
rsx! { h3 { "Parameter - Fixed" } }
}
}