Create HTML elements and fragments using JSX.
npm install @snugjs/html
import {createElement} from '@snugjs/html';
document.body.appendChild(<h1>Hello, World!</h1>);
document.body.appendChild(createElement('h1', {}, 'Hello, World!'));
import {createElement, createElementFactory} from '@snugjs/html';
const Hello = createElementFactory('h1', (element, childNodes) => {
element.replaceChildren('Hello, ', ...childNodes, '!');
});
document.body.appendChild(<Hello>World</Hello>);
{
"jsx": "react",
"jsxFactory": "createElement",
"jsxFragmentFactory": "createFragment"
}