Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ function diffElementNodes(

newVNode._children = [];
} else {
if (oldHtml) dom.innerHTML = '';
if (oldHtml) dom.textContent = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have a test for the trusted HTML case if that's possible at all


if (
nodeType == 'foreignObject' ||
Expand Down
1 change: 1 addition & 0 deletions src/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export interface PreactElement extends preact.ContainerNode {
data?: CharacterData['data'];
// Property to set __dangerouslySetInnerHTML
innerHTML?: Element['innerHTML'];
textContent?: Element['textContent'];
remove?: Element['remove'];

// Attribute reading and setting
Expand Down
Loading