script.js

import {html, render} from 'https://scrapbox.io/api/code/programming-notes/htm@3.0.4%2Fpreact/script.js';
 
(() => {
	const root = document.getElementById('app-container');
	render(html`<p>Hello</p>`, root);
})()
  • This is the minimum rendering code.

    • This is how it looks with added styles.
      • image
    • I will bundle preact myself later.
  • It seems that you need to wrap the JSX syntax with “html““.