-
[React] Styled component props 문법Java Script & Type Script 2023. 3. 17. 00:42728x90
Styled component props 문법
const Stbutton=styled.button ` background: $ { props => props.bg} color: $ { props => props.bg === “blue” ? “white” : “black”} ` … return ( <div> <Stbutton bg=“blue”> </div> )
이게 무슨 문법인게 아니라 라이브러리사용법이라 그냥 이렇게 쓰라고 한다
ㅎㅎㅎ 하하
그리고
const StNewButton=styled.button(Stbutton)` //이렇게하면 복사됨 `
728x90'Java Script & Type Script' 카테고리의 다른 글
43. Ajax- Axios, Promise.all, fetch함수 복습하기 (0) 2023.03.18 [React] 컴포넌트의 Lifecycle [useEffect에대한 고찰 2] 컴포넌트야 인생 원래 그런거야 (0) 2023.03.18 39. [after final project] Gnims 개선 - 리액트 framer-motion 라이브러리로 애니메이션효과 넣기 (0) 2023.03.16 36.깃헙액션 배포용 환경변수파일 생성하기 env 깃헙액션 시크릿활용하기 (0) 2023.03.14 35.[React] Final project-마지막주 UT 피드백1-흐릿한 아이콘 문제 FIGMA 피그마 아이콘 svg export 로해결! (0) 2023.03.10