Last active
November 8, 2022 21:08
-
-
Save kiprasmel/b327e1d1bbca3b6806cc8549c6bb5bae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
- https://preactjs.com/guide/v10/getting-started#no-build-tools-route | |
- https://preactjs.com/guide/v10/getting-started#alternatives-to-jsx | |
--> | |
<script type="module"> | |
import * as preact from 'https://unpkg.com/preact?module'; | |
import htm from 'https://unpkg.com/htm?module'; | |
const h = htm.bind(preact.h); | |
window.preact = preact; | |
window.h = h; | |
function App(props) { | |
const greet = `hello ${props.name} from preact!`; | |
return h` | |
<h1>${greet}</h1> | |
`; | |
} | |
preact.render(h`<${App} name="world" />`, document.body); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment