Closed Dwyte closed 3 years ago
v6 doesn't include ResizeObserver polyfill by default.
Looking at the browser support I think this may be a problem https://caniuse.com/resizeobserver
Please try to import
import ResizeObserver from 'react-resize-detector/withPolyfill';
(the other parts remain the same)
the only difference with the default import is size: the default module is 3kb and the one with polyfill takes about 6kb
@maslianok I am getting cannot find module error. There's no /withPolyfill directory. I am using v6alpha.0.
@Dwyte please upgrade to the latest RC version "6.0.1-rc.5"
As we found in this issue https://github.com/maslianok/react-resize-detector/issues/123 the path should be react-resize-detector/build/withPolyfill
When I use the hook pattern for resize detection with ref it causes crashes on iOS 12 on any browser. (Firefox, Brave (Chromium-Based), Safari) on newer version of iOS and iphones it seems fine. I had the crash on iphone 6. Sorry If I couldn't give any more details as I cannot really access the debug logs of the browser since I don't have a mac computer.
Replacing it with the
withResizeDetector
pattern works fine tho.