Version: v4.8.1
use-boundingclientrect-ref
#
AboutA hook that tracks the boundingclientrect of an element. It returns a callbackRef so that the element node if changed is easily tracked.
#
Installation#
Importing the hook#
Usage#
ArgumentsN/A
#
Returns an array of 3 valuesReturn 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 Bhargav's discord serverYou can click on the floating discord icon at the bottom right of the screen and talk to us in our server.