Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the box options property for useResizeObserver #298

Open
noahlaux opened this issue Mar 30, 2023 · 0 comments · Fixed by noahlaux/react-hook#1 · May be fixed by #299
Open

Support the box options property for useResizeObserver #298

noahlaux opened this issue Mar 30, 2023 · 0 comments · Fixed by noahlaux/react-hook#1 · May be fixed by #299

Comments

@noahlaux
Copy link

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/

@noahlaux noahlaux changed the title Support the box options property Support the box options property for useResizeObserver Mar 30, 2023
noahlaux added a commit to noahlaux/react-hook that referenced this issue Mar 30, 2023
noahlaux added a commit to noahlaux/react-hook that referenced this issue Mar 30, 2023
[resize-observer] Fixes jaredLunde#298 Provide optional ResizeObserverOptions
@noahlaux noahlaux reopened this Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant