Skip to content

Instantly share code, notes, and snippets.

@cnocon
Last active September 1, 2020 22:37
Show Gist options
  • Save cnocon/94fae59cc3a9fbff40d630ab75c9ad0a to your computer and use it in GitHub Desktop.
Save cnocon/94fae59cc3a9fbff40d630ab75c9ad0a to your computer and use it in GitHub Desktop.
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