فهرست منبع

fix hydration mounted element

Evan Almloff 1 سال پیش
والد
کامیت
eb15014b9d
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      packages/web/src/rehydrate.rs

+ 2 - 2
packages/web/src/rehydrate.rs

@@ -128,9 +128,9 @@ impl WebsysDom {
                 for attr in *attrs {
                     if let dioxus_core::TemplateAttribute::Dynamic { id } = attr {
                         let attribute = &vnode.dynamic_attrs[*id];
-                        &attribute.attribute_type().for_each(|attribute| {
+                        let id = attribute.mounted_element();
+                        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 {