You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SVGElement.offsetWidth doesn't exist anymore, so useElementSize() always returns 0.
I've fixed this locally by replacing offsetWidth with getBoundingClientRect(), but wanted to discuss that before sending a PR as it's a breaking change per this answer on Stack Overflow.
One way around the breaking change would be to check whether the element is an HTML element or SVG element before calling getBoundingClientRect() - would that be good for you?
The text was updated successfully, but these errors were encountered:
Hi, useElementSize has been deprecated and should be replaced by useResizeObserver. It doesn't support svg, but you can wrap this svg in a div to have the expected behavior.
https://chromestatus.com/feature/5724912467574784
SVGElement.offsetWidth
doesn't exist anymore, souseElementSize()
always returns 0.I've fixed this locally by replacing
offsetWidth
withgetBoundingClientRect()
, but wanted to discuss that before sending a PR as it's a breaking change per this answer on Stack Overflow.One way around the breaking change would be to check whether the element is an HTML element or SVG element before calling
getBoundingClientRect()
- would that be good for you?The text was updated successfully, but these errors were encountered: