Skip to content

Commit

Permalink
refactor(jsx/dom): remove redundant code applyNode
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma committed Aug 18, 2024
1 parent 915a823 commit bb5ad26
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/jsx/dom/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,6 @@ const apply = (node: NodeObject, container: Container, isNew: boolean): void =>
applyNodeObject(node, container, isNew)
}

const applyNode = (node: Node, container: Container, isNew: boolean): void => {
if (isNodeString(node)) {
container.textContent = node.t
} else {
applyNodeObject(node, container, isNew)
}
}

const findChildNodeIndex = (
childNodes: NodeListOf<ChildNode>,
child: ChildNode | null | undefined
Expand Down Expand Up @@ -401,7 +393,7 @@ const applyNodeObject = (node: NodeObject, container: Container, isNew: boolean)
? (document.createElementNS(child.n, child.tag as string) as SVGElement | MathMLElement)
: document.createElement(child.tag as string)
applyProps(el as HTMLElement, child.props, child.pP)
applyNode(child, el as HTMLElement, isNewLocal)
applyNodeObject(child, el as HTMLElement, isNewLocal)
if (child.vR.length) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
delete (child as any).vR
Expand Down

0 comments on commit bb5ad26

Please sign in to comment.