浏览代码

don't remove realdom nodes when the element id changes

Evan Almloff 2 年之前
父节点
当前提交
52a74214da
共有 1 个文件被更改,包括 0 次插入4 次删除
  1. 0 4
      packages/native-core/src/real_dom.rs

+ 0 - 4
packages/native-core/src/real_dom.rs

@@ -79,10 +79,6 @@ impl<S: State<V>, V: FromAnyValue> RealDom<S, V> {
         if self.node_id_mapping.len() <= element_id.0 {
             self.node_id_mapping.resize(element_id.0 + 1, None);
         }
-        if let Some(Some(old_id)) = self.node_id_mapping.get(element_id.0) {
-            // free the memory associated with the old node
-            self.tree.remove(*old_id);
-        }
         self.node_id_mapping[element_id.0] = Some(node_id);
     }