react-hook
react-hook copied to clipboard
Support the box options property for `useResizeObserver`
Is your feature request related to a problem? Please describe. I'd like to be able to utilize the different resizing models for pixel perfect measuring
Describe the solution you'd like I'd like to be able to provide options to the resize observer upon creation
It could be done fx by providing a third parameter:
useResizeObserver(target, (entry) => setSize(entry.contentRect), { box: ['device-pixel-content-box']} );
Describe alternatives you've considered N/A
Additional context https://web.dev/device-pixel-content-box/