npm / use-resize-observer
use-resize-observer
What changed in use-resize-observer 7 to 10, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-30.
15 breaking2 new APIs and options1 performance3 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inituse-resize-observer 1014 changes
Breaking changes 11
The default export is removed; the package is named-export only.
Output targets ES2020, so IE11 is no longer supported.
The package exports map allows importing only the package root; deep imports into dist/ now fail with ERR_PACKAGE_PATH_NOT_EXPORTED.
The package is dropped as a runtime dependency, leaving zero runtime dependencies.
A genuine zero measurement is now reported as 0; undefined means only that no measurement has been made yet.
The payload now carries the raw ResizeObserverEntry, including every box size and entry.target.
Only the package root is importable; package subpaths are no longer available.
The /polyfilled entrypoint is removed.
react-dom is no longer a peer dependency.
The minimum supported React version is 18.2.
The global augmentation adding devicePixelContentBoxSize was removed; consumers need a recent TypeScript DOM lib or their own declaration.
Behavior and default changes 1
Observation now works across windows and in iframes.
Fixes and other changes 2
A measured zero is reported as 0 rather than undefined.
React 19 is supported, React 18 remains supported, and the peer range is open-ended for future majors.
use-resize-observer 92 changes
Behavior and default changes 1
The library now takes Element, not only HTMLElement, to be consistent with ResizeObserver.
Fixes and other changes 1
Fixes were added for React 18.
use-resize-observer 84 changes
Breaking changes 1
Removed resize-observer-polyfill in favour of @juggle/resize-observer.
New APIs and options 2
Added the box option.
Added the round option.
Fixes and other changes 1
The onResize callback is no longer incorrectly called with the same values.
use-resize-observer 76 changes
Breaking changes 3
The callbackRef return value is no longer provided.
The returned ref is now a RefCallback rather than a ref object.
The hook always returns the same RefCallback, including when a custom ref object is passed.
Performance 1
A ResizeObserver instance is created only when there is an element to observe.
Behavior and default changes 1
The ref option now accepts raw elements as well as refs.
Fixes and other changes 1
Fixes an edge case where the hook tried to set state after its host component had unmounted.