Skip to content

Commit

Permalink
feat: add primitive conditional to patch object prop
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Feb 7, 2024
1 parent de730ef commit 8408351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/nodeOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8408351

Please sign in to comment.