@acusti/use-bounding-client-rect
Version:
React hook that returns the boundingClientRect for an element and triggers an update when those dimensions change
12 lines (9 loc) • 955 B
Markdown
# @acusti/use-bounding-client-rect
[](https://www.npmjs.com/package/@acusti/use-bounding-client-rect)
[](https://npms.io/search?q=%40acusti%2Fuse-bounding-client-rect)
[](https://www.npmjs.com/package/@acusti/use-bounding-client-rect)
[](https://bundlejs.com/?q=%40acusti%2Fuse-bounding-client-rect)
`useBoundingClientRect` is a React hook that returns the
`boundingClientRect` for the passed in HTMLElement and uses
`ResizeObserver` to update the return value and trigger a new render when
the HTMLElement’s `boundingClientRect` changes.