Using the latest v5, I ran into an issue of media queries being ordered wrong when used with a breakpoints _object_ and defaultProps. This worked fine in v4.
Here's a https://codesandbox.io/s/styled-system-defaultprops-breakpoints-410v5 with a reproduction. I'll hold back from explaining what is going on there for now (in the hope that the sandbox code is self explanatory).


I have the same problems, in my case:
example from rebass
const Header = styled(Text)({})
Header.defaultProps = {
m: 0,
mb: '8px'
}
So the defaultProps now override all m, mb when I create <Header mb={10} />
I have the same issue but actually in v4. Unfortunately, for some reason, I can't reproduce it. It behaves like that in my project but not in any other environment :confused:
I think this was resolved in v5.0.18, but feel free to reopen this if you still notice the issue:
https://codesandbox.io/s/styled-system-defaultprops-breakpoints-bs2gf
Most helpful comment
I have the same problems, in my case:
example from
rebassSo the
defaultPropsnow override allm,mbwhen I create<Header mb={10} />