Closed adirsation closed 2 years ago
Same for me. It's simply not supported, see: https://caniuse.com/?search=resize-observer
@maslianok would you accept a PR (which would at least prevent the crash behavior)? Haven't checked the src code yet, maybe I could contribute something during the holidays.
@adirsation @carmnk Thank you for the feedback!
All versions below 7.0.0 have a build with polyfill, e.g. you can import
import ResizeObserver from 'react-resize-detector/build/withPolyfill';
It uses this polyfill.
Unfortunately, it's not been updated for a long time and caused some problems for other users, but overall it works well.
So in case you need support for older browsers you can use this polyfill. I think something like this should work:
import ResizeObserver from 'resize-observer-polyfill';
if (!window.ResizeObserver) {
window.ResizeObserver = ResizeObserver;
}
@maslianok would you accept a PR (which would at least prevent the crash behavior)?
Of course I would accept a PR :) Thank you in advance!
Let me know if you have any questions
Safari browser on version 13.3 crashes with
typeerror undefined is not a constructor
onnew window.ResizeObserver