Skip to content

Commit

Permalink
[fix] ref() should call on Node mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Nov 9, 2024
1 parent a41040d commit 067b11e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dom-renderer",
"version": "2.4.2",
"version": "2.4.3",
"license": "LGPL-3.0-or-later",
"author": "shiy2008@gmail.com",
"description": "A light-weight DOM Renderer supports Web components standard & TypeScript language",
Expand Down
4 changes: 2 additions & 2 deletions source/dist/DOMRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ export class DOMRenderer {
reusedVNode || new VNode({ tagName: vNode.tagName, node: vNode.node }),
vNode
);
if (node) vNode.ref?.(node);

return node;
}

Expand Down Expand Up @@ -120,6 +118,8 @@ export class DOMRenderer {
for (const vNode of deletingGroup[selector]) this.deleteNode(vNode);

this.commitChildren(node, newNodes as ChildNode[]);

for (const { ref, node } of newList) ref?.(node);
}

handleCustomEvent(node: EventTarget, event: string) {
Expand Down

0 comments on commit 067b11e

Please sign in to comment.