chore: get create working and simplify dynamic nodes
This commit is contained in:
1 parent
16a521a601
commit
3c19def550
16 files changed
+168
-173
No files matched your search
+2
-2
@@ -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>()
|
||||
|
||||
@@ -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!"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user