fix scope context
This commit is contained in:
1 parent
04cdb14e5b
commit
cb4c46154d
7 files changed
+83
-45
No files matched your search
@@ -3,6 +3,7 @@ use crate::{
|
||||
bump_frame::BumpFrame,
|
||||
innerlude::DirtyScope,
|
||||
nodes::RenderReturn,
|
||||
scope_context::ScopeContext,
|
||||
scopes::{ScopeId, ScopeState},
|
||||
virtual_dom::VirtualDom,
|
||||
};
|
||||
@@ -20,7 +21,7 @@ impl VirtualDom {
|
||||
let entry = self.scopes.vacant_entry();
|
||||
let id = ScopeId(entry.key());
|
||||
|
||||
entry.insert(ScopeState {
|
||||
let scope = entry.insert(ScopeState {
|
||||
runtime: self.runtime.clone(),
|
||||
context_id: id,
|
||||
|
||||
@@ -35,7 +36,13 @@ impl VirtualDom {
|
||||
|
||||
borrowed_props: Default::default(),
|
||||
attributes_to_drop: Default::default(),
|
||||
})
|
||||
});
|
||||
|
||||
let context =
|
||||
ScopeContext::new(name, id, parent_id, height, self.runtime.scheduler.clone());
|
||||
self.runtime.create_context_at(id, context);
|
||||
|
||||
scope
|
||||
}
|
||||
|
||||
pub(crate) fn run_scope(&mut self, scope_id: ScopeId) -> &RenderReturn {
|
||||
|
||||
Reference in new issue
Block a user