Skip to content

Releases: maslianok/react-resize-detector

v12.0.2

06 Jan 13:31
62b05b6
Compare
Choose a tag to compare

What's Changed

  • Fix lodash submodules import #257
  • Update README with new 2025 year
  • Migrates Eslint setup to v9 flat config

v12.0.0

06 Jan 13:28
62b05b6
Compare
Choose a tag to compare

What's Changed

  • ⚠️ This module is now pure ESM
  • Add React 19 to peerDependencies
  • Update dev dependencies

Full Changelog: v11.0.0...v12.0.0

v11.0.0

28 May 15:31
d46ada8
Compare
Choose a tag to compare

What's Changed

⚠️ Migration guide

  • The onResize function now receives a single object. Destructure width and height parameters as follows:
- onResize: (width, height) => {
+ onResize: ({ width, height, entry }) => {
    if (width && height) {
        ...
    }
}

When the element is mounted, width and height will always be numbers. When unmounted, they will be null.
Ensure to add null checks before accessing element dimensions to address TypeScript errors.

Note that entry, a ResizeObserverEntry triggered by ResizeObserver, is now accessible. This provides access to borderBoxSize, contentBoxSize, and target, useful for custom logic or calculating border/padding size.
Refer to the ResizeObserverEntry documentation.

  • If observerOptions.box is set to border-box, the returned width and height from the useResizeDetector hook will include the padding and border size of the element. Default behavior remains unchanged - padding and border size are not included.

  • Rename ReactResizeDetectorDimensions to Dimensions

- import type { ReactResizeDetectorDimensions } from "react-resize-detector/build/types/types"
+ import type { Dimensions } from "react-resize-detector"

Full Changelog: v10.0.0...v11.0.0

v10.0.0

13 Jan 16:10
4b60055
Compare
Choose a tag to compare

⚠️ Breaking Changes

v10.0.0-beta.2

12 Jan 08:21
3e792f8
Compare
Choose a tag to compare

v10.0.0-beta.1

04 Jan 15:06
5996935
Compare
Choose a tag to compare
v10.0.0-beta.1 Pre-release
Pre-release

What's Changed

  • Fix ref .current set by using a proxy by @hugo-vrijswijk in #249
  • Update dependencies
  • Remove unused ChildFunctionProps type export

New Contributors

Full Changelog: v9.1.1...v10.0.0-beta.1

v9.1.2-beta.0

04 Jan 14:58
5996935
Compare
Choose a tag to compare
v9.1.2-beta.0 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v9.1.1...v9.1.2

v10.0.0-beta.0

23 Dec 11:08
Compare
Choose a tag to compare
v10.0.0-beta.0 Pre-release
Pre-release

We've streamlined the library by eliminating all methods except hooks.
Starting from this version the useResizeObserver hook is the only way to attach the observer.

v9.1.1

23 Dec 11:05
Compare
Choose a tag to compare
  • fix useResizeDetector in React StrictMode #247

v9.1.0

09 Apr 13:38
Compare
Choose a tag to compare

useResizeDetector performance optimization and refactoring.
No API changes.