feat: components pass thru children

This commit is contained in:
Jonathan Kelley committed 2022-11-02 17:29:18 -07:00
1 parent b6c0bce89c
commit c6a6c3d0f8
17 files changed
+581 -298

No files matched your search

+8 -10
View File
@@ -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);