Last active
December 31, 2018 15:58
-
-
Save flavioribeirojr/1809b1f5fd3525bacd58beef1fbbb634 to your computer and use it in GitHub Desktop.
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
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