feat: works with components

This commit is contained in:
Jonathan Kelley committed 2022-11-02 17:36:36 -07:00
1 parent c6a6c3d0f8
commit dddbcfd5e2
2 files changed
+16 -23

No files matched your search

+1 -1
View File
@@ -95,7 +95,7 @@ impl ScopeState {
// }
DynamicNode {
path: &[],
path: &[0],
kind: DynamicNodeKind::Component {
name: fn_name,
can_memoize: P::IS_STATIC,
+15 -22
View File
@@ -189,41 +189,34 @@ fn children_processes_properly() {
use dioxus::prelude::*;
fn app(cx: Scope) -> Element {
let d = 123;
render! {
div {
"yo!"
"yo!"
"yo!"
"yo!"
"yo!"
Child {}
Child {}
Child {}
Child {}
ChildWithChildren {
"hii"
p {
"{d}"
"hii"
}
}
(0..10).map(|f| rsx! {
"div {f}"
})
}
}
}
/// Yo its the child component!
fn Child(cx: Scope) -> Element {
render! ( div { "child" } )
}
#[inline_props]
fn ChildWithChildren<'a>(cx: Scope<'a>, children: Element<'a>) -> Element {
render! {
div {
"div"
children
}
h1 { children }
}
}
let mut dom = VirtualDom::new(app);
let mut mutations = vec![];
dom.rebuild(&mut mutations);
dbg!(mutations);
let mut mutations = vec![];
dom.rebuild(&mut mutations);
dbg!(mutations);
}