Closed multivoltage closed 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:
boxBackground
or something.I'm not agree but I'll try to use different implementation :)
Environment
Following there is my local pc env. The isse on codesanbox is impossible to fetch
System:
Binaries:
npmPackages:
Reproduction
https://codesandbox.io/p/sandbox/strange-johnson-8jrf82
Steps to reproduce
Box
that use variables with $ (example $background) since linter suggest to do not use directly "background" as props.Box
creatingconst MyBox = styled(Box)
Expected Behavior
MyBox
should receive correctly prop $backgroundActual Behavior
MyBox
receivesundefined
as $background