Created
January 31, 2020 01:05
-
-
Save jordangarcia/bc851b06d00b8d9925dc613d81cdd79f 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, { useEffect, useState } from "react"; | |
import { Flex, Title, Button } from "../../design/components"; | |
import { Link } from "react-router-dom"; | |
export default function Michael(props) { | |
const [greeting, setGreeting] = useState("initialValue"); | |
useEffect(() => { | |
alert("greeting changed"); | |
}, [greeting]); | |
return ( | |
<Flex | |
width="100%" | |
height="100vh" | |
alignItems="center" | |
justifyContent="center" | |
> | |
<div> | |
<Title size={1}>hello {greeting}</Title> | |
<Button | |
onClick={() => { | |
setGreeting("jordan"); | |
}} | |
mb={3} | |
> | |
change greeting | |
</Button> | |
<Link to="/"> | |
<Button variant="outline-error">leave page</Button> | |
</Link> | |
</div> | |
</Flex> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment