Last active
November 26, 2019 02:49
-
-
Save alejovdev/335aa215d39abb55f4d58f7ba219a72d 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
function Todos({}) { | |
// Create the state | |
const [_todos, setTodos] = useState(0); | |
return ( | |
<div className="todos"> | |
<Helmet> | |
{/* Display the state as string */} | |
<title>MyApp | Todos {_todos.toString()}</title> | |
</Helmet> | |
<h1>Todos</h1> | |
{/* Add one each click */} | |
<button onClick={() => setTodos(_todos + 1)}>Add todo</button> | |
<Link to="/config">Config</Link> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment