Skip to content

Instantly share code, notes, and snippets.

@Lyuji282
Created November 2, 2019 05:57
Show Gist options
  • Save Lyuji282/4e3632ccd2feace132f13f84c5d0e98c to your computer and use it in GitHub Desktop.
Save Lyuji282/4e3632ccd2feace132f13f84c5d0e98c to your computer and use it in GitHub Desktop.
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