use-resize-observer
use-resize-observer copied to clipboard
A React hook that allows you to use a ResizeObserver to measure an element's size.
Pretty much the title and according to https://caniuse.com/resizeobserver and other sources the ResizeObserver API landed in Safari on iOS 2020, so no poyfill is needed. My code works on Chrome...
👋 Hello. We have a component that’s using this hook with in it’s default form (no custom callback) and have been getting a lot of `ResizeObserver loop limit exceeded` errors...
Thank you for the great library!! Just wondering if there were any plans to expose the element's `x`, `y`, `top`, `left`, etc. coordinates since you are already accessing dimensions from...
With the current code, there is no way to differentiate a still unknown size from a 0 size
Hi @ZeeCoder , thanks for creating this library. We are using this package, and we'd like to help make it better. Our use case includes passing in child window's window...
Hi there, thanks for this great hook. Could you eventually release `useResolvedElement` as an external library? It would be good to reuse this without copying its function code.
I have a library where I don't necessarily want to polyfill ResizeObserver if a device is missing support, meaning I'd like to avoid calling useResizeObserver when ResizeObserver does not exist...
NextJS 15 RC just released which requires `react` 19. - loosen peer dependency versions to allow it - check that the library still works as expected with React 19 thanks!
When the component I am trying to observe is rendered in a separate window, it seems like it's size is not observed until hovering over the main window with the...
This solves issue #109 for me. The default ResizeObserver contructor acts on the default globalThis window, but in React it's possible to have a multi-window application. This gets the ownerDocument...