styled-components / styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
https://styled-components.com
MIT License
40.11k stars 2.48k forks source link

Override a styled component that use $ for variables does not pass props correctly #4266

Closed multivoltage closed 2 months ago

multivoltage commented 2 months ago

Environment

Following there is my local pc env. The isse on codesanbox is impossible to fetch

System:

Reproduction

https://codesandbox.io/p/sandbox/strange-johnson-8jrf82

Steps to reproduce

Expected Behavior

Actual Behavior

RowanDZ commented 2 months ago

This is expected behaviour: https://styled-components.com/docs/api#transient-props

$ is the Styled-components prefix for passing props to the CSS definition, without you need to worry that it will end up in the underlying component/element. It's actually very useful.

In your specific case, you could:

multivoltage commented 2 months ago

I'm not agree but I'll try to use different implementation :)