-
-
Save matthewharwood/e0bfba1f52fd9831a6c5a243212be5e2 to your computer and use it in GitHub Desktop.
Preact and htm on Deno
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
deno --importmap=import_map.json main.tsx |
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
{ | |
"imports": { | |
"htm": "https://unpkg.com/[email protected]/dist/htm.module.js", | |
"htm/preact": "https://unpkg.com/[email protected]/preact/index.module.js", | |
"preact": "https://unpkg.com/[email protected]/dist/preact.module.js", | |
"preact-render-to-string": "https://unpkg.com/[email protected]/dist/index.module.js" | |
} | |
} |
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
import { html } from "htm/preact"; | |
import render from "preact-render-to-string"; | |
function App() { | |
return html` | |
<h1>Hello, world!</h1> | |
`; | |
} | |
console.log(render(html`<${App} />`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment