Rebass: Creation of custom styled components

Created on 5 Apr 2018  Â·  3Comments  Â·  Source: rebassjs/rebass

Is there currently a way of creating custom components? Ideally through the use of styled-components 'styled' function?

All 3 comments

Not sure I understand the question. You can use styled-components directly to create whatever components you want

Thats what I would have assumed although that gives me the following error:

styled-components.browser.es.js:2211 It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles not rendering properly, errors happening during rehydration process and makes you application bigger without a good reason

Doing this also breaks the default theme in rebass.

You'll want to make sure you only install one instance of styled-components that's compatible with the range here https://github.com/jxnblk/rebass/blob/master/package.json#L29 – it might be worth rm -rf node_modules && npm i to see if that clears up your issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

contra picture contra  Â·  4Comments

ferdinandsalis picture ferdinandsalis  Â·  5Comments

borisyordanov picture borisyordanov  Â·  7Comments

oiojin831 picture oiojin831  Â·  3Comments

focux picture focux  Â·  5Comments