Animation & Timing
useResizeObserverRef
About
Resize Observer hook for React.
Examples
Basic usage
Arguments
| Argument | Type | Description | Default value | 
|---|---|---|---|
| callback | ResizeObserverCallback | Function that needs to be fired on resize | undefined | 
| options | ResizeObserverOptions | An options object allowing you to set options for the observation | { box: "content-box" } | 
Return value
Returns an array with one element
| Return value | Type | Description | 
|---|---|---|
| ref | CallbackRef | Ref which should be observed for Resize | 
Codesandbox Example
Basic Usage
Join Bhargav's discord server
You can click on the floating discord icon at the bottom right of the screen and talk to us in our server.