fix hydration

This commit is contained in:
Evan Almloff committed 2023-09-27 10:22:49 -05:00
1 parent 3e55bb8885
commit c137357094
2 files changed
+15 -13

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ impl ScopeContext {
parent.name parent.name
); );
if let Some(shared) = parent.shared_contexts.borrow().iter().find_map(|any| { if let Some(shared) = parent.shared_contexts.borrow().iter().find_map(|any| {
tracing::trace!("found context {:?}", any.type_id()); tracing::trace!("found context {:?}", (**any).type_id());
any.downcast_ref::<T>() any.downcast_ref::<T>()
}) { }) {
return Some(shared.clone()); return Some(shared.clone());
+14 -12
View File
@@ -128,18 +128,20 @@ impl WebsysDom {
for attr in *attrs { for attr in *attrs {
if let dioxus_core::TemplateAttribute::Dynamic { id } = attr { if let dioxus_core::TemplateAttribute::Dynamic { id } = attr {
let attribute = &vnode.dynamic_attrs[*id]; let attribute = &vnode.dynamic_attrs[*id];
let value = &attribute.value; &attribute.attribute_type().for_each(|attribute| {
let id = attribute.mounted_element(); let value = &attribute.value;
mounted_id = Some(id); let id = attribute.mounted_element();
let name = attribute.name; mounted_id = Some(id);
if let AttributeValue::Listener(_) = value { let name = attribute.name;
let event_name = &name[2..]; if let AttributeValue::Listener(_) = value {
self.interpreter.new_event_listener( let event_name = &name[2..];
event_name, self.interpreter.new_event_listener(
id.0 as u32, event_name,
event_bubbles(event_name) as u8, id.0 as u32,
); event_bubbles(event_name) as u8,
} );
}
});
} }
} }
if let Some(id) = mounted_id { if let Some(id) = mounted_id {