From 847b1af73f0b3da9fe147605768fac379fdb6f91 Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:40:31 +0900 Subject: [PATCH] Update store.ts --- src/core/store.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/store.ts b/src/core/store.ts index fef2c272..35d996d4 100644 --- a/src/core/store.ts +++ b/src/core/store.ts @@ -400,7 +400,10 @@ export const createVirtualStore = ( mutated = UPDATE_VIRTUAL_STATE + UPDATE_SIZE_EVENT; // Synchronous update is necessary in current design to minimize visible glitch in concurrent rendering. - // However in React, synchronous update with flushSync after asynchronous update will overtake the asynchronous one. + // However this seems to be the main cause of the errors from ResizeObserver. + // https://github.com/inokawa/virtua/issues/470 + // + // And in React, synchronous update with flushSync after asynchronous update will overtake the asynchronous one. // If items resize happens just after scroll, race condition can occur depending on implementation. shouldSync = true; break;