Haven't had any luck extending styles. Here is a gist of the relevant code.
rm -rf node_modules && npm iThe code is pretty standard as far as I can tell.
Cheers
Just made an isolated repro, and it works just fine. I'm having a hard time figuring what about my project is causing the issue. There are a lot of technologies playing together.
Let me know if you see anything obvious.
Yeah, I'm not sure what the culprit here is. I'd suggest trying to isolate the issue by trying styled-components without Rebass, and also trying the previous stable releases of both styled-components and rebass – the example code in the gist looks fine from what I can tell though
I've done a lot of hacking. The issue only appears once extending Rebass Button.
styled.button for instance, is working as expected. styled(Button), no luck. I'll open it up with the styled-components guys and see if they see an error.
I had the same problem. Downgraded to 2.3.4 and it worked.
Looked into it further and realized extended ANY existing styled component using styled(Component) isn't working in my project. This one doesn't seem to be a Rebass issue.
A fix for this was released in v4.0.0-beta.8.
Long story short if two versions of hoist-non-react-statics are bundled together they poison each other.
Most helpful comment
A fix for this was released in v4.0.0-beta.8.
Long story short if two versions of hoist-non-react-statics are bundled together they poison each other.