Describe the bug
I'm getting this strange error while trying to pass bg prop.
To Reproduce
You can see it on every fresh react/typescript install with styled-components/styled-system
Use codesandbox to create a reproduction:
For quick check :https://codesandbox.io/s/intelligent-hopper-67362?file=/tsconfig.json:0-224
@genesis-algorithms
I just spent a long time figuring this out as well! You still have to define your styled component types explicitly even when using the styled-system functions.
interface IProps {
bg?: string | null;
}
const Button = styled.button<IProps>`
${color}
`;
Will fix this!
Does the latest react break the types?
I'm closing this since @chrisMYchen answer was what I was looking for... Thanks, everyone!
Most helpful comment
@genesis-algorithms
I just spent a long time figuring this out as well! You still have to define your styled component types explicitly even when using the styled-system functions.
Will fix this!