Skip to content

Commit

Permalink
Extract into separate func
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Oct 12, 2024
1 parent 5e04644 commit e109c40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benches/src/02_replace1k.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const elementSelector = 'tr:first-child > td:first-child';

// MUST BE KEPT IN SYNC WITH WARMUP COUNT IN benches/scripts/config.js
const WARMUP_COUNT = 25;
const WARMUP_COUNT = 5;
for (let i = 0; i < WARMUP_COUNT; i++) {
markRunStart(`warmup-${i}`);
run();
Expand Down
4 changes: 1 addition & 3 deletions src/diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,10 @@ function diffElementNodes(
}

// @ts-expect-error
dom.textContent = newChildren;
dom.textContent = text;
}
} else {
if (oldHtml) dom.innerHTML = '';
// Previous render was a single text child. New children are not so let's
// unmount the previous text child
if (typeof oldProps.children === 'string') {
dom.removeChild(dom.firstChild);
}
Expand Down

0 comments on commit e109c40

Please sign in to comment.