Created
November 2, 2019 05:57
-
-
Save Lyuji282/4e3632ccd2feace132f13f84c5d0e98c 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, useEffect } from "react"; | |
import styled from "@emotion/styled"; | |
import Zoom from "react-reveal"; | |
import Grid from "@material-ui/core/Grid"; | |
import Button from "@material-ui/core/Button"; | |
const Component = () => { | |
const [value, setValue] = useState(0); | |
const callAfterDomRendered = async () => { | |
}; | |
useEffect(() => { | |
callAfterDomRendered(); | |
}, []); | |
return ( | |
<Container> | |
<Grid container spacing={10} direction="column" alignItems="center"> | |
<Grid item xs={12}> | |
<Zoom bottom> | |
<Text> | |
{value} | |
</Text> | |
</Zoom> | |
</Grid> | |
<Grid item xs={12}> | |
<Zoom bottom> | |
<Button onClick={_ => { | |
setValue(value + 1); | |
}}> | |
<Text> | |
CLICK ME | |
</Text> | |
</Button> | |
</Zoom> | |
</Grid> | |
</Grid> | |
</Container> | |
); | |
}; | |
const Container = styled.main` | |
`; | |
const Text = styled.div` | |
text-align: center; | |
font-weight: bold; | |
font-size: 48px; | |
margin: 120px 0; | |
`; | |
export default Component; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment