JSFiddle - React, Tailwind, and code Playground

by Josh Pullen

HTML

<div id="app"></div>

JavaScript

import { html, render, useRef } from "https://unpkg.com/htm/preact/standalone.module.js";

function App() {
	return html`
  	<h1>Math Art</h1>
    <div>asdf</div>
  `;
}

function Canvas({ render, ...props }) {
	const ref = useRef(null);
  
  useEffect(() => {
  
  }, [render]);

	return html`
  	<canvas ref=${ref} ...${props}></canvas>
  `;
}

render(html`<${App} />`, document.querySelector("#app"));