μ€νμΌλ μ»΄ν¬λνΈλ₯Ό μμ±νκ³ , ν΄λΉ νκ·Έμ props λ₯Ό λ΄λ €λ°μ μμ±μ ν΄λΉνλ μ€νμΌμ μ²λ¦¬ν΄μ£ΌκΈ°μν΄ μ¬μ©νλ€.
...
<St.ButtonWrapper size={size} state={state} disabled={isDisabled}>
...
export const ButtonWrapper = styled.button<{ size: ButtonSize; state: ButtonState }>`
display: flex;
justify-content: center;
...
λ λνλκ²μλ λ¬Έμ κ° μμ§λ§, ν΄λΉ button νκ·Έμ νμμλ μμ±λ€μ΄ λΆμκ³ , μλλ λ€λ₯ΌκΉ warning λ¬Έκ΅¬κ° λ°μνμλ€.
styled-components: it looks like an unknown prop "state" 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.)
μ¬λ¬κ°μ§ λ°©λ²μ΄ μμ§λ§, λ΄κ° μ νν λ°©λ²μ transient propsλ₯Ό μ¬μ©νλκ²μ ννμλ€.
$ μ λμ¬λ₯Ό μ¬μ©νμ¬ transient propsλ₯Ό λ§λ€λ©΄, μ΄ propsλ styled componentμ μ€νμΌλ§μ μν΄ μ¬μ©λμ§λ§ μ€μ DOM μμλ‘ μ λ¬λμ§ μμ μνλ λ°©ν₯μ΄λ€.
...
<St.ButtonWrapper $size={size} $state={state} disabled={isDisabled}>
...
</St.ButtonWrapper>
...
export const ButtonWrapper = styled.button<{ $size: ButtonSize; $state: ButtonState }>`
display: flex;
justify-content: center;
...