Rebass: 3.0.0-8: Problem extending component styles

Created on 14 Sep 2018  Â·  6Comments  Â·  Source: rebassjs/rebass

Haven't had any luck extending styles. Here is a gist of the relevant code.

Debugging steps taken

  • Updated all related packages to latest version
    (rebass, styled-components, babel-plugin-styled-components, gatsby-plugin-styled-components)
  • Reset node_modules
    rm -rf node_modules && npm i
  • Reset browser cache

The code is pretty standard as far as I can tell.
Cheers

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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

focux picture focux  Â·  5Comments

karland picture karland  Â·  7Comments

jxnblk picture jxnblk  Â·  5Comments

hellais picture hellais  Â·  7Comments

steida picture steida  Â·  4Comments