-
-
Notifications
You must be signed in to change notification settings - Fork 43
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 for SVG elements #91
Comments
Seems like the TS types will need to change from using |
🎉 This issue has been resolved in version 9.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you very much! |
I checked working with SVG. Does not work. The height variable is always zero. |
Could you please provide reproduction in codesandbox? |
https://codesandbox.io/s/use-resize-observer-hsxycd?file=/src/App.tsx It is required to display a square in the middle of the browser. But instead of the browser dimensions, the dimensions of the square are substituted in height, width. |
Here's a slightly modified version of that sandbox: As you can see the hook reports the same exact values that a raw ResizeObserver reports, so I see no issues with the hook based on this example. |
Why doesn't it return the dimensions of the SVG container? |
Not 100% sure, the ResizeObserver spec around SVGs is a bit weird. Here's some stuff I found, hope it helps:
Also I wonder if you could just wrap your SVG in a div and measure that instead? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Will there be support for SVG elements or not?
Now the error appears. Since the SVG element is not compatible with the HTML element.
The text was updated successfully, but these errors were encountered: