react-use icon indicating copy to clipboard operation
react-use copied to clipboard

"ResizeObserver loop limit exceeded" when using useMeasure

Open gajus opened this issue 5 years ago • 4 comments

The issue is described here:

This error means that ResizeObserver was not able to deliver all observations within a single animation frame. It is benign (your site will not break). – Aleksandar Totic Apr 15 at 3:14

https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded

The solution is described here:

Simply need to add window.requestAnimationFrame.

https://stackoverflow.com/a/58701523/368691

gajus avatar Oct 08 '20 16:10 gajus

What is useMeasureDirty?

It is not exported anywhere.

gajus avatar Oct 08 '20 16:10 gajus

Seems like there is an associated PR to export useMeasureDirty.

gajus avatar Oct 08 '20 16:10 gajus

There is any special reason for not using window.requestAnimationFrame by default? Or at least don't default export the useMeasure.

I'm facing multiple Sentry reports because of this. I'll use useMeasureDirty with the full path import, but would be really nice to expose this as any other hook.

gil0mendes avatar Nov 03 '22 15:11 gil0mendes

same here. still facing this issue as of Dec 2023

steelx avatar Dec 18 '23 07:12 steelx