Open peterpme opened 4 years ago
@peterpme What's your use case?
When you wrap your component with withTheme
HOC then the component automatically gets the ability to accept a theme
prop where you can pass whole theme or part of the theme to override it.
useTheme
hook accepts theme as an argument just to imitate that functionality which we get out of the box with HOC.
If you need the same component to use a different theme then I would suggest creating another component on top of the first one and passing theme props you'd like to change.
Summary
Hi, I noticed that
useTheme
allows you to (partially) override the theme. There are situations where I'd like to be able to do that withwithTheme
, ie:I have tried to look at ways of solving this otherwise but we don't support hooks yet and this felt like the right way.
The complicated part is how this line is handled:
My simple solution is;
but I know I can improve on this
Test plan
My solution is not 100% yet but it's in a working state so I wanted to open up the PR early and get your thoughts
Thank you!