react-cosmos / rfcs

Change requests for React Cosmos
MIT License
1 stars 2 forks source link

Is there a way to use react-cosmos with styled-components ? #23

Closed Ezazhel closed 3 years ago

Ezazhel commented 3 years ago

Hi !

I'm trying to use react-cosmos with my components but I'm using styled-components and obvisouly an error occur :

Cannot read property 'xxx' of undefined.

My "components look like this :

image

I don't know how to export my theme, Can I have a "master" components taking my fixtures as children ? And import my theme in the master component ?

"Like a ThemeProvider"

Ezazhel commented 3 years ago

Ok...

Nevermind ! Decorator on the way, my bad.

I put a decorator in src.

image

And it works.