1
0
Эх сурвалжийг харах

feat: add primitive conditional to patch object prop

alvarosabu 1 жил өмнө
parent
commit
8408351e87

+ 1 - 1
src/core/nodeOps.ts

@@ -192,7 +192,7 @@ export const nodeOps: RendererOptions<TresObject, TresObject | null> = {
     if (node) {
     if (node) {
       let root = node
       let root = node
       let key = prop
       let key = prop
-      if (key === 'object' && prevValue !== null) {
+      if (node.__tres.primitive && key === 'object' && prevValue !== null) {
         // If the prop 'object' is changed, we need to re-instance the object and swap the old one with the new one
         // If the prop 'object' is changed, we need to re-instance the object and swap the old one with the new one
         const newInstance = nodeOps.createElement('primitive', undefined, undefined, { 
         const newInstance = nodeOps.createElement('primitive', undefined, undefined, { 
           object: nextValue, 
           object: nextValue,