DEV Community

Discussion on: How are you using Styled Components?

larsejaas profile image
Lars Ejaas

Hmm, I really love this. However, I tried it and couldn't make it work. Do you need a workaround when using several different themes? I am unsure how this would work?

Thread Thread
marcelxsilva profile image
Marcelo Silva

it is necessary to have the ThemeProvider configured at the root of the project. I usually use the routes file as children of the ThemeProvider.

when dealing with different themes, it will depend a lot on how you will inject the settings

Thread Thread
larsejaas profile image
Lars Ejaas

Yeah, that makes sense! But I need to do some rework on the way I implement themes in styled components. Would like to optimize my workflow further, and your idea using lodash is really great, I defininitely need to include this!