Browse Source

Merge pull request #715 from Demonthos/dont-remove-realdom-nodes-when-the-element-id-changes

don't remove real dom nodes when the id is recycled
Jon Kelley 2 năm trước cách đây
mục cha
commit
4fdab915c2
1 tập tin đã thay đổi với 0 bổ sung4 xóa
  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);
     }