export const St = {
CardContainer: styled.div`
display: flex;
justify-content: center;
background-color: ${theme.colors.orange};
height: 100vh;
`,};
Styled-Component 의 장점
: 재사용이 가능
하다! St 객체로 컴포넌트를 감싼 뒤, export 해 보는 건 어떨까요?? :)
return (
<St.CardContainer> // 사용 시엔 객체니까 St. 으로 접근해주면 돼요!!
{isLoading ? (
<St.SkeletonCard></St.SkeletonCard>
) : isError ? (
<>Not Found</>
) : (
<St.Card>
컴포넌트 최상단에 감싸는 것은 St{컴포넌트명}Wrapper.
rem 단위
만 사용하기
ex) 112px → 11.2rem
import IcUp from './ic_up.svg?react';
import IcTime from './ic_time.svg?react';
export {
IcUp,
IcTime,
...};
import { IcUp, IcTime } from '../../assets/icons';
<IcUp />
<IcTime />