styled-component (1) 썸네일형 리스트형 styled-components best practices(모범 사례) styled-components(emotion 등)을 잘 사용하는 방법을 정리해 봅니다. 1. variant와 as를 사용해 스타일 재사용 styled-component에서 스타일을 재사용 하는 방법은 보통 합성입니다. 이 경우 해당 컴포넌트의 특수화에는 좋지만, 아래와 같이 여러 컴포넌트가 있다는 것을 사용자가 알아야 합니다. 이는 객체지향 프로그래밍의 합성과 유사한 사용 사럐입니다. const ButtonStyle = styled.button` color: ${(props) => props.theme.primary}; `; const ButtonStyleFlashy = styled(ButtonStyle)` color: fuchsia; `; const ButtonDisabled = styled(Butt.. 이전 1 다음