This should be faster than useEffect which only executes after the entire render has been committed to the DOM.
This should be faster than useEffect which only executes after the entire render has been committed to the DOM.