Hi,
As the subject, need help in configuring vite so it can build into static html files.
Thanks,
Vikas
Hi Vikas,
Sorry for the late reply.
You can convert your HTML code to tsx using this converter and then render the tsx components, the alternative solution for rendering the static HTML is to use dangerouslySetInnerHTML.
import DOMPurify from "dompurify";
const myHTML = `<h1>John Doe</h1>`;
const mySafeHTML = DOMPurify.sanitize(myHTML);
const App = () => <div dangerouslySetInnerHTML={{ __html: mySafeHTML }} />;