Last active
March 26, 2018 09:39
-
-
Save zouhir/33e1929441b4a2301cd6f7cf34974c91 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
import { h, render, Component } from "preact"; | |
class HelloWidget extends Component { | |
render() { | |
let time = new Date().toLocaleTimeString(); | |
let name = this.props.name || "nobody"; | |
return <h1>{`Hello ${name}, time is: ${time}`}</h1>; | |
} | |
} | |
// render an instance of Widget into <body>: | |
render(<HelloWidget />, document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment