streamich / react-use

React Hooks — 👍
http://streamich.github.io/react-use
The Unlicense
41.75k stars 3.14k forks source link

"ResizeObserver loop limit exceeded" when using useMeasure #1555

Open gajus opened 4 years ago

gajus commented 4 years ago

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 commented 4 years ago

What is useMeasureDirty?

It is not exported anywhere.

gajus commented 4 years ago

Seems like there is an associated PR to export useMeasureDirty.

gil0mendes commented 1 year ago

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.

steelx commented 10 months ago

same here. still facing this issue as of Dec 2023