Releases: maslianok/react-resize-detector
v12.1.0
What's Changed
- Add TypeScript configuration and update module imports for compatibility by @binhpv in #263
- Fix typo
ResfreshModeType>RefreshModeType - Update dev dependencies
- Update Readme
New Contributors
Full Changelog: v12.0.0...12.1.0
v12.0.2
v12.0.0
v11.0.0
What's Changed
⚠️ Migration guide
- The
onResizefunction now receives a single object. Destructurewidthandheightparameters 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.boxis set toborder-box, the returnedwidthandheightfrom theuseResizeDetectorhook will include the padding and border size of the element. Default behavior remains unchanged - padding and border size are not included. -
Rename
ReactResizeDetectorDimensionstoDimensions
- 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
⚠️ Breaking Changes
- Beginning with version 10, the library supports the
useResizeObserverhook only - Drop support for React 16 and 17
v10.0.0-beta.2
⚠️ Breaking Changes
What's Changed
- Cleanup example code
- Regenerate example dependencies using pnpm
- Remove outdated tests
- Update latest bundlephobia gzip size
- Update dev dependencies
- Add pnpm-lock.yaml to prettierignore
- Run prettier + lint-fix once
- Bump TS target to es6
Full Changelog: v10.0.0-beta.1...v10.0.0-beta.2
v10.0.0-beta.1
What's Changed
- Fix ref
.currentset by using a proxy by @hugo-vrijswijk in #249 - Update dependencies
- Remove unused
ChildFunctionPropstype export
New Contributors
- @hugo-vrijswijk made their first contribution in #249
Full Changelog: v9.1.1...v10.0.0-beta.1
v9.1.2-beta.0
What's Changed
- Fix ref
.currentset by using a proxy by @hugo-vrijswijk in #249
New Contributors
- @hugo-vrijswijk made their first contribution in #249
Full Changelog: v9.1.1...v9.1.2
v10.0.0-beta.0
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.