Last active
September 1, 2020 22:37
-
-
Save cnocon/94fae59cc3a9fbff40d630ab75c9ad0a 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'; | |
function App() { | |
const [ score, setScore ] = useState(0); | |
const [ message, setMessage ] = useState('Welcome!'); | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<h1>{ message }</h1> | |
<h2>{ score }</h2> | |
<button onClick={() => setScore(score + 1)}> | |
Increase score | |
</button> | |
</header> | |
</div> | |
) | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment