use-resize-observer
A React hook that allows you to use a ResizeObserver to measure an element's size.
react-hook-dimensions
React Hook to get DOM Element `BoundingClientRect` together with the `page offset` snapshot, that covers all your needs. What makes the package different - You can trigger an update when you really need it.