jaredLunde / jaredLunde/react-hook
Support the box options property for `useResizeObserver`
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
**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:
```js
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/
Contributor guide
Research direction
Start at the useResizeObserver entry point and review its current arguments and ResizeObserver setup. Check how the hook exposes observer configuration, then verify that the requested box option can be passed through and that the pixel-perfect measurement example behaves as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100