웹/React
[React] Warning: React does not recognize the `isActive` prop on a DOM element.
ohojee
2023. 9. 4. 10:07
Warning: React does not recognize the `isActive` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isactive` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
오류가 아닌 경고이기에 지나쳐도 상관은 없지만 콘솔창에 계속 뜨는게 번거로워 다시 찾아봤다.
알고보니 styled-component의 버전 관련한 문제였다.
isActive는 v5에서 사용되는 옵션이고, 나는 v6을 사용하기에 warning이 뜬거였다. 경고 메세지를 읽어보니 isactive처럼 소문자로 바꾸면 된다고 해서 바꿨더니 경고가 사라졌다.
참고 자료
https://stackoverflow.com/questions/76857070/styled-component-error-it-looks-like-an-unknown-prop-responsive-is-sent-throu