component-size
component-size copied to clipboard
Does not work with SVG elements
offsetHeight/offsetWidth do not work with elements often in the DOM that are not actually HTML Elements, for example, SVG elements.
I'd recommend using clientHeight/clientWidth when the offset versions are undefined, but it could be considered a breaking change.
Another possibility would be to allow the passing of a callback to override getSize.