반응형
크롬 개발자 도구에서 Console창을 보니까 이런 이상한 에러가 콘솔창을 도배하고 있었다.
React does not recognize the customStyle prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase customstyle instead.
customStyle을 React가 못 알아먹고 있으니까 customstyle로 이름을 바꾸라는 소리다. 하지만 소문자로 바꿔도 계속 경고 메세지가 출력된다.
이때는 변수 앞에다가 '$'를 붙이면 문제가 해결된다.
export const Container = styled.div<{
$customStyle?: RuleSet
}>`
${props => props.$customStyle};
${FlexLayout({})};
flex: 1;
`;
반응형
'공부 > Web' 카테고리의 다른 글
PHP - print와 echo 함수의 차이 (0) | 2024.07.06 |
---|---|
JS - Template literals란 무엇인가? (0) | 2024.07.06 |
Web - N년 전, N개월 전, N일 전, N시간 전, N분 전, 방금 전 코드 구현하기 (0) | 2024.07.04 |
Web - "Assign object to a variable before exporting as module default import/no-anonymous-default-export"에러 해결하는 법 (0) | 2024.07.02 |
CSS - 스크롤 바(Scroll bar) 가리는 법 (0) | 2024.07.02 |