-
-
Save jgierer12/0c27e3507504e835b83d989a40a5a494 to your computer and use it in GitHub Desktop.
Try it online! https://codepan.net/gist/0c27e3507504e835b83d989a40a5a494
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
{"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