Skip to content

Commit

Permalink
fix(web-components): fix null and undefined in jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Oct 15, 2023
1 parent b4d521f commit 076c6aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jsx-runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Type, Props } from "../types/index";

function escapeHTML(unsafeText: unknown) {
if (typeof unsafeText !== 'string') return unsafeText;
if (typeof unsafeText !== 'string') return unsafeText ?? "";
let div = document.createElement('div');
div.innerText = unsafeText;
return div.innerHTML;
Expand Down

0 comments on commit 076c6aa

Please sign in to comment.