Created
August 29, 2020 20:36
-
-
Save ricardocanelas/9a856ee733cfcfe89dbee17a4a4b580d to your computer and use it in GitHub Desktop.
Preact Example
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Preact</title> | |
</head> | |
<body> | |
<script type="module"> | |
import { | |
html, | |
render, | |
} from "https://unpkg.com/htm/preact/index.mjs?module"; | |
function MyComponent(props) { | |
return html`<div>My name is ${props.name}</div>`; | |
} | |
const App = html`<div> | |
<${MyComponent} name="John Doe" /> | |
</div>`; | |
render(App, document.body); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://lit-html.polymer-project.org/