Skip to content

Instantly share code, notes, and snippets.

@jgierer12
Last active January 30, 2018 15:07
Show Gist options
  • Save jgierer12/0c27e3507504e835b83d989a40a5a494 to your computer and use it in GitHub Desktop.
Save jgierer12/0c27e3507504e835b83d989a40a5a494 to your computer and use it in GitHub Desktop.
{"js":{"code":"/* @jsx h */\nconst { Component, h, render } = preact\n\nclass App extends Component {\n state = {\n count: 0\n }\n\n inc = () => this.setState({\n count: this.state.count + 1\n })\n\n dec = () => this.setState({\n count: this.state.count - 1\n })\n\n render() {\n return (\n <div>\n <h2>{ this.state.count }</h2>\n <button onClick={this.inc}>Increment</button>\n <button onClick={this.dec}>Decrement</button>\n </div>\n )\n }\n}\n\nrender(<App />, document.body)\n","transformer":"babel"},"css":{"code":"","transformer":"css"},"html":{"code":"<script src=\"https://unpkg.com/preact@7.2.1/dist/preact.js\"></script>\n","transformer":"html"},"showPans":["js","output"],"activePan":"output"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment