react-container-dimensions
react-container-dimensions copied to clipboard
getBoundingClientRect takes `transform: scale` into account
If some parent element has a transform: scale
applied then getBoundingClientRect
will take it into account and return actual sizes. This might be undesirable in some situations so probably offsetWidth
and offsetHeight
are better options but they won't work with SVG elements AFAIK.