Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- reacts3
- next #middleware
- .env
- max_allowed_packet
- AWS
- express
- EC2
- 부족한 금액 계산하기
- vscode
- utf8mb4
- react
- Node
- dotenv
- prettier
- 자동완성방지
- axios
- 제일 작은 수 제거하기
- s3확장자
- useReducer
- 코드정렬
- 리액트코드정렬
- 코딩테스트
- 프로그래머스
- MySQL
- 커밋 한번에
- elasticIP
- 프리티어
- interactive_timeout
- 리액트
- 자연수 뒤집어 배열로 만들기
Archives
- Today
- Total
Sungtt
styled component keyframes 변수,props 사용하기 본문
const moveVertically = (y) => keyframes`
0% {
transform : translateY(0px)
}
100% {
transform : translateY(${y}px)
}
`;
const BallAnimation = styled.g`
animation : ${props => moveVertically(props.y)} ${props => props.time}s linear
`;
키프레임 생성 시 인자를 받아서 호출하고,
컴포넌트에서는 애니메이션 호출 시 props값을 넘기면 된다.
'React' 카테고리의 다른 글
Comments