Created
December 8, 2019 05:39
-
-
Save alejovdev/91ce2a7dfd77340263c6cd8dd2da08f7 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 './App.css' | |
function App() { | |
const [views, setViews] = useState(0) | |
return ( | |
<div> | |
<h1>Live counter</h1> | |
<h2>{views}</h2> | |
<button onClick={e => setViews(views + 1)}>Add view</button> | |
</div> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment