Created
September 1, 2020 22:41
-
-
Save cnocon/6d98b1eaaa4f6c0fd6f9a5c0df0b30e5 to your computer and use it in GitHub Desktop.
Revisions
-
Cristin O'Connor created this gist
Sep 1, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ 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(prevScore => prevScore + 1)}> Increase score </button> </header> </div> ) }; export default App;