From cd9668411f74397920f0281bf2569d7b7bcb3204 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Wed, 27 Aug 2025 19:52:16 +0200 Subject: [PATCH 1/2] Prevent frequently updated components from retaining memory --- src/component.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/component.js b/src/component.js index 4dd23ec59c..0363096e3b 100644 --- a/src/component.js +++ b/src/component.js @@ -6,7 +6,8 @@ import { COMPONENT_FORCE, COMPONENT_DIRTY, MODE_HYDRATE, - NULL + NULL, + UNDEFINED } from './constants'; /** @@ -154,6 +155,7 @@ function renderComponent(component) { newVNode._original = oldVNode._original; newVNode._parent._children[newVNode._index] = newVNode; commitRoot(commitQueue, newVNode, refQueue); + oldVNode._parent = oldVNode._dom = NULL; if (newVNode._dom != oldDom) { updateParentDomPointers(newVNode); From 3ba61de40dba70decd7978fdcd4caf3a1dda00ae Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Wed, 27 Aug 2025 19:53:53 +0200 Subject: [PATCH 2/2] Update src/component.js --- src/component.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/component.js b/src/component.js index 0363096e3b..bdd89dc767 100644 --- a/src/component.js +++ b/src/component.js @@ -6,8 +6,7 @@ import { COMPONENT_FORCE, COMPONENT_DIRTY, MODE_HYDRATE, - NULL, - UNDEFINED + NULL } from './constants'; /**