본문 바로가기

Front-End

[Styled-components] it looks like an unknown prop "X" is being sent through to the DOM 오류 해결 (X: 사용자 정의)

styled-components: it looks like an unknown prop "backgroundcolor" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)

 

https://velog.io/@mintmin0320/styled-components-it-looks-like-an-unknown-prop-%EB%AC%B8%EC%A0%9C%EA%B0%80-%EB%90%98%EB%8A%94-props-is-being-sent-through-to-the-DOM-which-will-likely-trigger-a-React-console-error.-%EA%B2%BD%EA%B3%A0-%ED%95%B4%EA%B2%B0%EB%B2%95

 

$ 접두사를 붙여 해결했다.