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

web study

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

web study

검색하기 폼
  • 분류 전체보기 (201)
    • HTML (6)
    • CSS (6)
    • Programming (2)
    • JavaScript (61)
    • Data Structure & Algorithm (58)
    • Git (3)
    • React (22)
    • Vue (1)
    • Node.js, npm (1)
    • Network (1)
    • Java (5)
    • AWS (17)
    • Utility (4)
    • 협업 (1)
    • CUK 강의 정리 (2)
      • [이론] 컴퓨터학개론 (0)
      • [이론] 컴퓨터 네트워크 (0)
      • [이론] 클라우드 컴퓨팅 (2)
    • ETC. (10)
    • 기록 (0)
  • 방명록

Props (1)
[React] Styled-components+TypeScript Props 전달 시 부모 컴포넌트에서 에러가 발생할 경우

TypeScript와 Styled-components를 같이 사용하면서 아래와 같이 props 스타일을 지정해주었다. (styles.button.ts) export interface ButtonProps { size: string; } export const PrimaryButton = styled(StyledButton)` width: ${props => `${props.size === 'block' ? '100%' : 'auto'}`}; `; (Login.tsx) const Login = ({ size }: ButtonProps) => { // ... Login } 그런데 자꾸 부모 컴포넌트에서 에러가 발생했다. (App.tsx) Property 'size' is missing in type '{}'..

React 2022. 10. 7. 09:04
이전 1 다음
이전 다음
반응형
TAG
  • useReducer
  • SWAGGER
  • 알고리즘
  • HTML
  • 화살표함수
  • 반복문
  • 상태 관리
  • Redux
  • 이분 검색
  • 투 포인터
  • 투포인터
  • let
  • 반응형
  • react
  • state
  • 리액트
  • for문
  • 배열
  • Cloud Computing
  • TypeScript
  • 객체
  • 자바스크립트
  • Scss
  • if문
  • 아나그램
  • postman
  • 정렬
  • 파이썬
  • AWS
  • CSS
more
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/05   »
일 월 화 수 목 금 토
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 31

Blog is powered by Tistory / Designed by Tistory

티스토리툴바