Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Preact Example
<!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>
@ricardocanelas

This comment has been minimized.

Copy link
Owner Author

@ricardocanelas ricardocanelas commented Aug 29, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment