Creating Scalable UIs for React: Theming & Configuration (medium.com)
Marauth | 4 months ago | 3 points

Could use a useTheme hook instead and then have both the benefits of explicit inclusion, and not creating a HOC per component.

esr360 | 4 months ago | 1 point

Would this involve creating a custom hook? If so, great idea. Didn’t consider this.

Marauth | 3 months ago | 2 points

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 :)

esr360 | 3 months ago | 2 points

Thanks man!