script.js

import {html, render} from 'https://scrapbox.io/api/code/programming-notes/[email protected]%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““.