I want to wrap up my ant-design components with styled-components, I know that this is possible (https://gist.github.com/samuelcastro/0ff7db4fd54ce2b80cd1c34a85b40c08) however I
The root of the problem seems to be that styled-components
expects the inner component (AntButton
) to accept all the props in the specified interface (IButtonProps
), but AntButton
does not accept customProp
. To fix this, follow the last example in this section of the documentation and use a stateless function component to remove customProp
before calling AntButton
.
export const Button = styledComponents(
({ customProp, ...rest }) => )`
// any custom style here
`;