chore: get create working and simplify dynamic nodes

This commit is contained in:
Jonathan Kelley committed 2022-11-30 11:24:13 -05:00
1 parent 16a521a601
commit 3c19def550
16 files changed
+168 -173

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ fn app(cx: Scope) -> Element {
}
fn BlogPost(cx: Scope) -> Element {
let post = dioxus_router::use_route(&cx).last_segment()?;
let post = dioxus_router::use_route(&cx).last_segment().unwrap();
cx.render(rsx! {
div {
@@ -46,7 +46,7 @@ struct Query {
}
fn User(cx: Scope) -> Element {
let post = dioxus_router::use_route(&cx).last_segment()?;
let post = dioxus_router::use_route(&cx).last_segment().unwrap();
let query = dioxus_router::use_route(&cx)
.query::<Query>()
+2 -2
View File
@@ -165,13 +165,13 @@ fn app(cx: Scope) -> Element {
// Can pass in props directly as an expression
{
let props = TallerProps {a: "hello", children: Default::default()};
let props = TallerProps {a: "hello", children: cx.render(rsx!(()))};
rsx!(Taller { ..props })
}
// Spreading can also be overridden manually
Taller {
..TallerProps { a: "ballin!", children: Default::default() },
..TallerProps { a: "ballin!", children: cx.render(rsx!(()) )},
a: "not ballin!"
}