Add Classes to Styled Component

后端 未结 1 1343
庸人自扰
庸人自扰 2021-01-12 23:42

I am trying to add class names to a React Component to make it easier for me to customize that component using Styled Components. Here is a simplified outline of the compone

1条回答
  •  隐瞒了意图╮
    2021-01-13 00:00

    You need to provide className for the wrapper/container as styled-component injecting the styles through it:

    const SignupForm = ({ className }) => (
      
    ); const Form = styled(SignupForm)` .input { background-color: palegreen; } .button { background-color: palevioletred; } `;

    0 讨论(0)
提交回复
热议问题