Use this if you can't use template strings somehow and still want the performance to be 'decent'.
All the crap you need to do to set this up:
Add these stuff to tsconfig.json
:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@bit-js/jsx"
}
}
Then you can write JSX in your file:
const html: string = <p>Hi</p>;
And to escape some strings install @bit-js/web-utils
and do:
import { escapeHTML } from "@bit-js/web-utils";
const html: string = <div>{escapeHTML(htmlString)}</div>;