I have a curious question. My goal is to reduce the amount of hook calls and receive the best performance. My idea is to bind 2 variables, --bg and --fg to a theme and set them into the :root. I imagine that I might may not need a ThemeContext to wrap the entire App this way, and let the browser re-render on variable changes.
Which is faster - Binding the colors directly or using variables and letting the browser re-render on variable changes?
I have a curious question. My goal is to reduce the amount of hook calls and receive the best performance. My idea is to bind 2 variables,
--bg
and--fg
to a theme and set them into the:root
. I imagine that I might may not need a ThemeContext to wrap the entire App this way, and let the browser re-render on variable changes.Which is faster - Binding the colors directly or using variables and letting the browser re-render on variable changes?
Variable approach:
Binding colors directly: