Sungtt

[styled-components] React does not recognize the `ButtonBG` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `buttonbg` instead. If you accidentally passed it from a parent component, .. 본문

React

[styled-components] React does not recognize the `ButtonBG` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `buttonbg` instead. If you accidentally passed it from a parent component, ..

sungtt 2022. 12. 5. 22:09

 

framer motion과 styled components를 혼합하여 사용할 때 부터 생긴 오류다.

styled components에 props로 전달할 값들 이름 앞에 $를 붙임으로써 해결했다.

 

아래는 참고글

 

 

 

https://dev.to/jeansmaug/how-to-fix-the-received-true-for-a-non-boolean-attribute-error-3pm9

 

How to fix the 'Received "true" for a non-boolean attribute' error

How to fix Received 'true' for a non-boolean attribute error when using styled-components or emotion.

dev.to

https://styled-components.com/docs/api#transient-props

 

styled-components: API Reference

API Reference of styled-components

styled-components.com

 

Comments