Great article Sahz. I've read it before and why I'm still using the ThemeProvider approach is, there is no dark mode in my application, so there will be no re-render problem. Also, I'm not only sending colors, sizes etc. but also some helper functions and block styles from ThemeProvider which is not possible with CSS variables.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Sahz, I'm using ThemeProvider of styled-components and all colors, typography, sizes, shadows etc. are passed as props to components.
Doesn't ThemeProvider reduce performance of the app?
I went through a great article by Kent C.Dodds - epicreact.dev/css-variables/
He explains why using global css variables is more performant that using React context ThemeProvider
Great article Sahz. I've read it before and why I'm still using the ThemeProvider approach is, there is no dark mode in my application, so there will be no re-render problem. Also, I'm not only sending colors, sizes etc. but also some helper functions and block styles from ThemeProvider which is not possible with CSS variables.