Do you think you could add another argument to useDimensions() that lets you specify the type of measurement function?
For example, React Measure lets you choose between client, offset, and scroll (https://github.com/souporserious/react-measure#props), which are all slightly different measurement functions. I think there are also use cases for providing a getBBox() measurer.
My particular use-case is that I want the measurements in local SVG units, since they will inform the location of other SVG elements, so I need getBBox() as the source of the measurements, rather than getBoundingClientRect().
Do you think you could add another argument to
useDimensions()that lets you specify the type of measurement function?For example, React Measure lets you choose between
client,offset, andscroll(https://github.com/souporserious/react-measure#props), which are all slightly different measurement functions. I think there are also use cases for providing agetBBox()measurer.My particular use-case is that I want the measurements in local SVG units, since they will inform the location of other SVG elements, so I need
getBBox()as the source of the measurements, rather thangetBoundingClientRect().