Describe the bug
If you conditionally apply dangerouslySetInnerHTML, Preact internal code leads to a TrustedTypes violation.
To Reproduce
If possible, please provide a link to a StackBlitz/CodeSandbox/Codepen project or a GitHub repository that demonstrates the issue. You can use the following template on StackBlitz to get started: https://stackblitz.com/edit/create-preact-starter
Steps to reproduce the behavior:
- Go to https://codepen.io/lukewarlow/pen/wBMjmJM
- Click on "Toggle HTML" twice
- Open browser dev tools and see the Trusted Types violation (will need Chromium or Safari 26+)
Expected behavior
What should have happened when following the steps above?
The text should toggle between the two values.
Describe the bug
If you conditionally apply dangerouslySetInnerHTML, Preact internal code leads to a TrustedTypes violation.
To Reproduce
If possible, please provide a link to a StackBlitz/CodeSandbox/Codepen project or a GitHub repository that demonstrates the issue. You can use the following template on StackBlitz to get started: https://stackblitz.com/edit/create-preact-starter
Steps to reproduce the behavior:
Expected behavior
What should have happened when following the steps above?
The text should toggle between the two values.