styledcomponents2 [TIL] 내일배움캠프 React 과정 2023.02.20 Today I Learned 오후 3시에 원장님께 기본 기능 시연하고 피드백받기 로그인 모달, 회원가입 페이지 UI 구현 typescript에서 styled-components에 여러 개의 props를 넘길 경우 처음에는 props의 타입을 이렇게 지정해 줬었는데 CategoryBtn 하단으로 새로운 스타일 컴포넌트를 작성해도 폰트 색상이 원래대로 적용이 안 돼서 뭔가 이상한가 하는 생각에 문제를 찾다가 타입 지정을 뭔가 잘못해 준 거 같다는 것을 발견했다. interface CategoryBtnStyledProps { bg: string; text: string; border: string; } export const CategoryBtn = styled.button` padding: 0 17px; h.. 2023. 2. 21. [TIL] 내일배움캠프 React 과정 2022.12.15 Today I Learned React 숙련 개인 과제 수행 Redux로 TO DO LIST 구현하기 styled-components 사용하기 const Btn = styled.button` margin-right: 12px; height: 35px; width: 120px; border-radius: 20px; border: transparent; color: white; font-size: 16px; font-weight: bold; cursor: pointer; background-color: ${(props) => props.backgroundColor}; :hover { opacity: 0.8; } ` styled-components의 장점을 잘 보여주는 예시 코드. jsx에서 props를 넘겨.. 2022. 12. 16. 이전 1 다음