Skip to content

Commit

Permalink
lib/dom - improve 'createTextNode'
Browse files Browse the repository at this point in the history
  • Loading branch information
LankyMoose committed Oct 1, 2024
1 parent 226bf18 commit fe5d85d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/lib/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ function createDom(vNode: VNode): SomeDom {
}
function createTextNode(vNode: VNode): Text {
const prop = vNode.props.nodeValue
const isSig = Signal.isSignal(prop)
const value = unwrap(prop)
const el = document.createTextNode(value)
if (isSig) {
subTextNode(vNode, el, prop)
const textNode = document.createTextNode(value)
if (Signal.isSignal(prop)) {
subTextNode(vNode, textNode, prop)
}
return el
return textNode
}

function updateDom(vNode: VNode) {
Expand Down

0 comments on commit fe5d85d

Please sign in to comment.