Procházet zdrojové kódy

feat: add primitive conditional to patch object prop

alvarosabu před 1 rokem
rodič
revize
8408351e87
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/core/nodeOps.ts

+ 1 - 1
src/core/nodeOps.ts

@@ -192,7 +192,7 @@ export const nodeOps: RendererOptions<TresObject, TresObject | null> = {
     if (node) {
       let root = node
       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
         const newInstance = nodeOps.createElement('primitive', undefined, undefined, { 
           object: nextValue,