feat: components pass thru children
This commit is contained in:
1 parent
b6c0bce89c
commit
c6a6c3d0f8
17 files changed
+581
-298
No files matched your search
@@ -16,10 +16,7 @@ fn basic_syntax_is_a_template(cx: Scope) -> Element {
|
||||
p { "you're great!" }
|
||||
div { background_color: "red",
|
||||
h1 { "var" }
|
||||
div {
|
||||
b { "asd" }
|
||||
"not great"
|
||||
}
|
||||
div { b { "asd" } "not great" }
|
||||
}
|
||||
p { "you're great!" }
|
||||
}
|
||||
@@ -30,16 +27,17 @@ fn basic_syntax_is_a_template(cx: Scope) -> Element {
|
||||
fn basic_template(cx: Scope) -> Element {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
(0..2).map(|i| rsx! {
|
||||
div { "asd" }
|
||||
}),
|
||||
(0..2).map(|i| rsx! {
|
||||
div { "asd" }
|
||||
})
|
||||
(0..2).map(|i| rsx! { div { "asd {i}" } })
|
||||
basic_child { }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// A beautiful component
|
||||
fn basic_child(cx: Scope) -> Element {
|
||||
todo!()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn basic_prints() {
|
||||
let mut dom = VirtualDom::new(basic_template);
|
||||
|
||||
Reference in new issue
Block a user