feat: works with components
This commit is contained in:
1 parent
c6a6c3d0f8
commit
dddbcfd5e2
2 files changed
+16
-23
No files matched your search
@@ -95,7 +95,7 @@ impl ScopeState {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
DynamicNode {
|
DynamicNode {
|
||||||
path: &[],
|
path: &[0],
|
||||||
kind: DynamicNodeKind::Component {
|
kind: DynamicNodeKind::Component {
|
||||||
name: fn_name,
|
name: fn_name,
|
||||||
can_memoize: P::IS_STATIC,
|
can_memoize: P::IS_STATIC,
|
||||||
|
|||||||
@@ -189,41 +189,34 @@ fn children_processes_properly() {
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
fn app(cx: Scope) -> Element {
|
fn app(cx: Scope) -> Element {
|
||||||
|
let d = 123;
|
||||||
|
|
||||||
render! {
|
render! {
|
||||||
div {
|
div {
|
||||||
"yo!"
|
|
||||||
"yo!"
|
|
||||||
"yo!"
|
|
||||||
"yo!"
|
|
||||||
"yo!"
|
|
||||||
Child {}
|
|
||||||
Child {}
|
|
||||||
Child {}
|
|
||||||
Child {}
|
|
||||||
ChildWithChildren {
|
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]
|
#[inline_props]
|
||||||
fn ChildWithChildren<'a>(cx: Scope<'a>, children: Element<'a>) -> Element {
|
fn ChildWithChildren<'a>(cx: Scope<'a>, children: Element<'a>) -> Element {
|
||||||
render! {
|
render! {
|
||||||
div {
|
h1 { children }
|
||||||
"div"
|
|
||||||
children
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut dom = VirtualDom::new(app);
|
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);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user