fix(core): polyfill resize-observer for development to avoid error overlay (#5943)

Brought a temporary solution from https://github.com/petyosi/react-virtuoso/issues/875#issuecomment-1962897033
This commit is contained in:
Peng Xiao
2024-02-28 08:18:33 +00:00
parent 82f21ac60b
commit 35454c3bfc
5 changed files with 20 additions and 9 deletions
+1
View File
@@ -1,5 +1,6 @@
import './polyfill/intl-segmenter';
import './polyfill/request-idle-callback';
import './polyfill/resize-observer';
import { assertExists } from '@blocksuite/global/utils';
import { StrictMode } from 'react';
@@ -0,0 +1,8 @@
import { ResizeObserver } from '@juggle/resize-observer';
// prevents the following error in development mode:
// ResizeOvserver loop limit exceeded
// https://github.com/petyosi/react-virtuoso/issues/875#issuecomment-1962897033
if (process.env.NODE_ENV !== 'production') {
window.ResizeObserver = ResizeObserver;
}