Can anyone recommend the best way to compose styled-component
s that need to be themed?
Here's my code: https://gist.github.com/aaronmcadam/7bfd63a6bc4cfc36f9947a449c6f494a.
I have an Avatar
component which composes an Image
component, which is itself a styled-component
.
If I use Avatar.styled.js
with <ThemeProvider>
, the theme can be successfully overridden.
If I use Avatar.withTheme.js
, the theme can only be overridden if I use withTheme
.
Which is the preferred way of doing things like these?