Skip to content

Commit

Permalink
Test some performance stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Oct 2, 2024
1 parent 6a66daa commit 0677d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/diff/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
EMPTY_ARR,
EMPTY_OBJ,
MODE_HYDRATE,
MODE_SUSPENDED,
Expand Down Expand Up @@ -498,7 +499,7 @@ function diffElementNodes(
dom.innerHTML = newHtml.__html;
}

newVNode._children = [];
newVNode._children = EMPTY_ARR;
} else {
if (oldHtml) dom.innerHTML = '';

Expand Down
5 changes: 4 additions & 1 deletion src/diff/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export function setProperty(dom, name, value, oldValue, namespace) {

if (typeof value == 'function') {
// never serialize functions as attribute values
} else if (value != null && (value !== false || name[4] === '-')) {
} else if (
value != null &&
(value !== false || (name.length > 4 && name[4] === '-'))
) {
dom.setAttribute(name, name == 'popover' && value == true ? '' : value);
} else {
dom.removeAttribute(name);
Expand Down

0 comments on commit 0677d63

Please sign in to comment.