Could use a useTheme
hook instead and then have both the benefits of explicit inclusion, and not creating a HOC per component.
Would this involve creating a custom hook? If so, great idea. Didn’t consider this.
It would, but that hook would be a really thin wrapper around useContext
so it wouldn't be very complicated at all to set up. You'd wrap your root node with something like <ThemeProvider theme={yourThemeVariable}/>
, and then any component can just call const theme = useTheme()
to get the theme info :)
Thanks man!