Skip to content

Commit

Permalink
Update store.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Oct 14, 2024
1 parent 249eff3 commit 847b1af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 847b1af

Please sign in to comment.