#Suggestions for minimal JSX rendering?
6 messages · Page 1 of 1 (latest)
I recommend https://deno.land/x/nano_jsx@v0.0.36
nano_jsx didn't seem to be a drop-in replacement, but after a bit of poking around in preact, it doesn't appear to be all that excessive really anyway. And I've managed to par it down to the bare essentials using a minimal preact.js and import map...
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
},
"imports": {
"preact": "./preact.js",
"preact/": "https://esm.sh/*preact@10.12.1/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.6"
}
}
export { createElement as h } from "preact/src/create-element.js";
export const options = {};
export function Fragment(props) {
return props.children;
}
^ ./preact.js