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
Hello there! I'm trying to get the absolute minimum usage example working, and am running into an issue. I have tried on linux and mac, on firefox and chrome, and cannot get it to work.
You will see that the onResize function is being called with the new size, however, the width variable returned by useResizeObserver is not getting updated.
The text was updated successfully, but these errors were encountered:
Since you're passing in "onResize", you're actually opting out of the width/height responses. This is because the callback allows you to opt out of rendering altogether.
The width/height responses doesn't seem to work with react 18 anyway, and are stuck at the default "1x1" for me. 🤷♂️
I'm working on an update to make the hook compatible, so this'll be a good test case.
# [9.0.0](v8.0.0...v9.0.0) (2022-05-15)
### Bug Fixes
* Added some fixes for React 18. ([852d976](852d976)), closes [#90](#90) [#91](#91) [#92](#92)
### BREAKING CHANGES
* The lib now takes "Element", not only "HTMLElement", to
be consistent with ResizeObserver.
Hello there! I'm trying to get the absolute minimum usage example working, and am running into an issue. I have tried on linux and mac, on firefox and chrome, and cannot get it to work.
Here is a code sandbox reproducing it:
https://codesandbox.io/s/exciting-surf-uos1hs?file=/src/App.js
You will see that the
onResize
function is being called with the new size, however, thewidth
variable returned byuseResizeObserver
is not getting updated.The text was updated successfully, but these errors were encountered: