A hook that tracks the boundingclientrect of an element. It returns a callbackRef so that the element node if changed is easily tracked.
Doesn't take any arguments.
Return value | Type | Description | Default value |
---|---|---|---|
ref | Callback ref | A callback ref function to use as a ref for the component that needs to be tracked | () => null |
value | DOMRect | DOMRect Object containing x,y, width, height, left,right,top and bottom keys | null |
update | Function | Function that can be called at any time to force a recalculation of the clientrect | null |
Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!