maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

ResizeObserver loop limit exceeded in v9.1.0 #241

Closed char0n closed 6 months ago

char0n commented 1 year ago

Hi,

Thanks for great work!

After updating from 8.1.0 to 9.1.0 I've started to see ResizeObserver loop limit exceeded error.

image

I needed to add refreshMode and refreshRate options for application to work as before.

  const { ref } = useResizeDetector({
    onResize: handleResize,
    refreshMode: 'debounce',
    refreshRate: 0,
  });

Affected application: https://github.com/swagger-api/swagger-editor/tree/next


This is IMHO very strange as 9.0.0 release notes states that those options are no longer needed.

snelsi commented 1 year ago

@char0n Could you please provide a Codepen reproduction of the bug? This would greatly assist us in identifying the root cause of the issue and finding a solution

char0n commented 1 year ago

Hi @snelsi, unfortunately I don't think so. I can only reproduce in SwaggerEditor@5 when full codebase is involved.

Would the dev setup of SwaggerEditor@5 help you https://github.com/swagger-api/swagger-editor/tree/next#development to set the SwaggerEditor@5 locally?

Shen120 commented 1 year ago

I also encountered this bug, but I did not reproduce it in the demo! this version is latest 9.1.0 image

This is a Demo

hassenc commented 1 year ago

I've noticed I was having infinite re-renders without any errors. I rolled back to 9.0.0, it doesn't have the issue

snelsi commented 6 months ago

Because this issue seems to have been inactive for quite some time now, I'm closing it as stale. If you're still encountering this bug in v10, feel free to reopen it.

char0n commented 6 months ago

I haven't seen it in v10.