Skip to content

Instantly share code, notes, and snippets.

@flavioribeirojr
Last active December 31, 2018 15:58
Show Gist options
  • Save flavioribeirojr/1809b1f5fd3525bacd58beef1fbbb634 to your computer and use it in GitHub Desktop.
Save flavioribeirojr/1809b1f5fd3525bacd58beef1fbbb634 to your computer and use it in GitHub Desktop.
import React, { useState } from 'react'
import ReactDOM from 'react-dom';
function App() {
const [count, setCount] = useState(0)
function incrementCount() {
setCount(count + 1)
}
return (
<div>
<h3>You clicked { count } times!</h3>
<button
onClick={incrementCount}
>
Click here!
</button>
</div>
)
}
ReactDOM.render(
<App />,
document.getElementById('root')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment