Closed javiergonzalezGenially closed 3 years ago
You can simply polyfill your environment prior to including your app code, or do it within your bundler. See the rollup config I use to create a polyfilled version here.
The quickest solution could also be making a module like this:
import useResizeObserver from 'use-resize-observer';
import resizeObserverPolyfill from 'some-resize-observer-polyfill';
if (!window.ResizeObserver) {
window.ResizeObserver = resizeObserverPolyfill;
}
export default useResizeObserver;
:tada: This issue has been resolved in version 8.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I'd like to inject a polyfill when window.ResizeObserver is not available. By adding a customResizeObserver optional option I could do:
This PR does that.