diff --git a/src/core/vdom.ts b/src/core/vdom.ts index e63124ec3..ebe2936d2 100644 --- a/src/core/vdom.ts +++ b/src/core/vdom.ts @@ -2064,7 +2064,7 @@ export function renderer(renderer: () => RenderResult): Renderer { let rendered: RenderResult; let invalidate: () => void; - next.properties = next.node.properties; + next.properties = { ...next.node.properties }; next.id = next.id || `${wrapperId++}`; _idToWrapperMap.set(next.id, next); const { id, depth, order } = next; @@ -2175,7 +2175,7 @@ export function renderer(renderer: () => RenderResult): Renderer { next.hasAnimations = hasAnimations; next.id = id; next.childDomWrapperId = current.childDomWrapperId; - next.properties = next.node.properties; + next.properties = { ...next.node.properties }; _wrapperSiblingMap.delete(current); if (domNode && domNode.parentNode) { next.domNode = domNode; diff --git a/tests/core/unit/vdom.tsx b/tests/core/unit/vdom.tsx index 10a99f3e0..21c5110ab 100644 --- a/tests/core/unit/vdom.tsx +++ b/tests/core/unit/vdom.tsx @@ -3487,6 +3487,35 @@ jsdomDescribe('vdom', () => { }); }); + it('should clone properties', () => { + const factory = create().properties<{ count: number }>(); + const Foo = factory(function Foo({ properties }) { + return