typescript-plugin-styled-components icon indicating copy to clipboard operation
typescript-plugin-styled-components copied to clipboard

Doesn't transform styled components with config

Open vladislaver opened this issue 4 years ago • 1 comments

StyledComponentsTransformer ignores styled components with config like this:

const Box = styled.div.withConfig<Props>({
    shouldForwardProp: (prop, defaultValidatorFn) =>
        !['display'].includes(prop) && defaultValidatorFn(prop),
})`
    display: ${prop => prop.display};
`;

[email protected] [email protected] [email protected]

vladislaver avatar Oct 28 '21 12:10 vladislaver

Hm, it's not supported because withConfig was not part of the public surface. I guess it was changed some time ago. I would argue if you use useConfig manually it should opt out of display name generation. I will need to investigate how well it would be working with multiple useConfig.

Igorbek avatar Nov 04 '21 05:11 Igorbek