feat: transition to cx, props

This commit is contained in:
Jonathan Kelley committed 2021-09-21 13:13:15 -04:00
1 parent f1cff845ce
commit bfdcb20437
14 files changed
+88 -50

No files matched your search

+2 -2
View File
@@ -130,7 +130,7 @@ impl VirtualDom {
// Safety: this callback is only valid for the lifetime of the root props
let root_caller: Box<dyn Fn(&Scope) -> DomTree> = Box::new(move |scope: &Scope| unsafe {
let props: &'_ P = &*(props_ptr as *const P);
std::mem::transmute(root(Context { props, scope }))
std::mem::transmute(root(Context { scope }, props))
});
let scheduler = Scheduler::new();
@@ -203,7 +203,7 @@ impl VirtualDom {
let root_caller: Box<dyn Fn(&Scope) -> DomTree> =
Box::new(move |scope: &Scope| unsafe {
let props: &'_ P = &*(props_ptr as *const P);
std::mem::transmute(root(Context { props, scope }))
std::mem::transmute(root(Context { scope }, props))
});
root_scope.update_scope_dependencies(&root_caller, ScopeChildren(&[]));