fix hydration

This commit is contained in:
Evan Almloff 2023-09-27 10:22:49 -05:00
parent 3e55bb8885
commit c137357094
2 changed files with 15 additions and 13 deletions

View file

@ -128,7 +128,7 @@ impl ScopeContext {
parent.name
);
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>()
}) {
return Some(shared.clone());

View file

@ -128,18 +128,20 @@ impl WebsysDom {
for attr in *attrs {
if let dioxus_core::TemplateAttribute::Dynamic { id } = attr {
let attribute = &vnode.dynamic_attrs[*id];
let value = &attribute.value;
let id = attribute.mounted_element();
mounted_id = Some(id);
let name = attribute.name;
if let AttributeValue::Listener(_) = value {
let event_name = &name[2..];
self.interpreter.new_event_listener(
event_name,
id.0 as u32,
event_bubbles(event_name) as u8,
);
}
&attribute.attribute_type().for_each(|attribute| {
let value = &attribute.value;
let id = attribute.mounted_element();
mounted_id = Some(id);
let name = attribute.name;
if let AttributeValue::Listener(_) = value {
let event_name = &name[2..];
self.interpreter.new_event_listener(
event_name,
id.0 as u32,
event_bubbles(event_name) as u8,
);
}
});
}
}
if let Some(id) = mounted_id {