1
2
3
4
5
6
7
8
9
10
11
export const preactTest = (async () => {
const { useState, h, htm, renderToString } = await import(
"https://npm.reversehttp.com/preact,htm,preact/hooks,preact-render-to-string"
);
const html = htm.bind(h);
function Component() {
const [count, setCount] = useState(0);
return html`<div class="foo">${count}</div>`;
}
return renderToString(h(Component));
})();