Skip to content

Instantly share code, notes, and snippets.

@krasimir
Created November 11, 2018 04:51
Show Gist options
  • Save krasimir/20ac41cf847a9ac20b212cca8ddb9205 to your computer and use it in GitHub Desktop.
Save krasimir/20ac41cf847a9ac20b212cca8ddb9205 to your computer and use it in GitHub Desktop.
Demoit example
const useState = React.useState;
const App = function () {
const [ count, change ] = useState(0);
console.log(`count is: ${ count }`);
return (
<section>
<h1>Counter: { count }</h1>
<button onClick={ () => change(count + 1) }>
Click me
</button>
</section>
)
}
ReactDOM.render(<App />, document.querySelector('.output'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment