본문 바로가기 메뉴 바로가기

양자놀이터

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

양자놀이터

검색하기 폼
  • 분류 전체보기 (9)
    • STACK (9)
  • 방명록

Props (1)
다중 props 상태로 styled-components 스타일링 하기

styled-components는 컴포넌트 간의 분리와 재사용성을 높여주며, 스타일의 일관성을 유지하는 데 도움이 됩니다. 부모 컴포넌트에서 상속받은 props의 상태가 여러 상황일 때, 효율적인 사용방법을 알아보겠습니다. 물론 저는 Next.js와 Typescript 사용을 기본으로 합니다. 1. 재사용할 Button 컴포넌트 만들기import Link from 'next/link'; import styled from 'styled-components'; const Button = ({ size, href, children }: ButtonStyledType)) => { const { size, href, children } = props; return ( {children} ); }; export d..

STACK 2023. 6. 20. 00:56
이전 1 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바