This comment has been minimized.

This comment has been minimized.

@dimitarnestorov Thanks, changed it to window and moved into useEffect callback to avoid SSR issues with window not being defined. What is the rationale behind wrapping the callback in requestAnimationFrame? Since this effect fires infrequently seems like an unnecessary performance optimization to me.