import React from 'react';
export var useVirtuosoResizeErrorFix = function useVirtuosoResizeErrorFix() {
  // this fix is borrowed from the official Virtuoso+React Beautiful DnD sandbox implementation
  // https://virtuoso.dev/react-beautiful-dnd/
  React.useEffect(function () {
    var targetErrors = ['ResizeObserver loop completed with undelivered notifications.', 'ResizeObserver loop limit exceeded'];
    var onWindowError = function onWindowError(e) {
      if (targetErrors.includes(e.message)) {
        e.stopImmediatePropagation();
      }
    };
    window.addEventListener('error', onWindowError);
    return function () {
      window.removeEventListener('error', onWindowError);
    };
  }, []);
};
//# sourceMappingURL=useVirtuosoResizeErrorFix.js.map