Skip to content

Commit

Permalink
Ignores already-removed elements in SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesol committed Jul 29, 2024
1 parent a3224ae commit d0fe90b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deku-core/src/Deku/Toplevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ export const transformTextNode = (id) => (textNode) => () => {
let beforeComment = document.createComment(`d$i@${id}`);
let afterComment = document.createComment(`d$o@${id}`);

textNode.parentNode.insertBefore(beforeComment, textNode);
textNode.parentNode.insertBefore(afterComment, textNode);
textNode.parentNode.insertBefore(textNode, afterComment);
if (textNode && textNode.parentNode) {
textNode.parentNode.insertBefore(beforeComment, textNode);
textNode.parentNode.insertBefore(afterComment, textNode);
textNode.parentNode.insertBefore(textNode, afterComment);
}
};

export const mapIdsToTextNodes = (rootElement) => () => {
Expand Down

0 comments on commit d0fe90b

Please sign in to comment.