mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user