useResizeObserver is improperly described in docs
ckperez opened this issue · comments
Uses the ResizeObserver API to observe changes within the given HTML Element DOM Rect.
Asynchronously observes changes in the DOM Rect of the given HTML Element.
These lines from the docs (emphasis my own) suggest that the values of the DOMRect are being observed for changes to them. The DOMRect is largely positional data from which the size of an element can be calculated. This hook observes changes to the size of the provided element and returns DOMRect data, but it does not observe the DOMRect data for the changes.
A button which is moved within its parent as part of a responsive UI due to a window resize will have new DOMRect values after the move, but that move would not be observed by this hook (nor by the resizeObserver at all) if the button were the element observed by it.