본문 바로가기
개발/삽질

TailWind, React에서 svg사용때 주의사항

by 백아절현 2023. 5. 8.
ackend_compact.js:2367  Warning: Invalid DOM property `stroke-width`. Did you mean `strokeWidth`?
    at svg
    at div
    at div
    at Node (http://localhost:3000/static/js/bundle.js:1451:7)
    at div
    at $164e874d21fcd87e$export$f9c541e71856c524 (http://localhost:3000/static/js/bundle.js:69989:11)
    at RowContainer (http://localhost:3000/static/js/bundle.js:70840:12)
    at div
    at InnerElement (http://localhost:3000/static/js/bundle.js:70629:12)
    at div
    at Outer (http://localhost:3000/static/js/bundle.js:70600:15)
    at List (http://localhost:3000/static/js/bundle.js:107272:30)
    at div
    at $065a164934293bf2$export$ff4858a4110d9246 (http://localhost:3000/static/js/bundle.js:70907:49)
    at $f13a06e5444f84b6$export$cdf2ef3f6364d85 (http://localhost:3000/static/js/bundle.js:71757:62)
    at $5d6a5680e6f62734$export$a6ee728c3c6ef11d (http://localhost:3000/static/js/bundle.js:71753:49)
    at DndProvider (http://localhost:3000/static/js/bundle.js:73584:23)
    at $dac24389e46ba09d$export$c49dab5eb1b4ce0c (http://localhost:3000/static/js/bundle.js:71668:16)
    at $2ba43033bb8eb39d$var$TreeComponent (http://localhost:3000/static/js/bundle.js:71960:67)
    at div
    at Left (http://localhost:3000/static/js/bundle.js:1425:72)
    at App
overrideMethod @ react_devtools

 

브라우저에서 위와같은 오류를 쏟아내었다.

 

webpack으로 뭘 해줘야 하나 별거 다 찾아보다가 결국에는 오류에 보면 적혀있다.

 

`stroke-width`. Did you mean `strokeWidth`? 라고 React에서 class 대신 className 쓰고 property에 - 대신 카멜 케이스 쓰는거 까먹고 복붙해서 한참찾음.

댓글