maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

Return width according to provided observerOptions #220

Closed moroine closed 6 months ago

moroine commented 1 year ago

According to the documentation, we can pass ObserverOptions https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe

But when using box: 'border-box' the width returned by the hook is always contentBox

snelsi commented 1 year ago

Created a CodeSandbox of the issue:

https://codesandbox.io/s/nostalgic-dew-egxddl?file=/src/App.tsx

Semigradsky commented 1 year ago

Sounds as breaking change

moroine commented 1 year ago

It could be an option to select the width to return

snelsi commented 6 months ago

Because this issue seems to have been inactive for quite some time now, I'm closing it as stale. If you're still encountering this bug in v10, feel free to reopen it.