You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is great, I would like to ask whether it can interrupt the rendering of react. For example, if there is a list of 10,000 length arrays and react updates this array when performing state updates, can it interrupt the rendering
The text was updated successfully, but these errors were encountered:
Hey, good question. I've been asked this before. Maybe I should add a FAQ section and include this question.
You can't interrupt the React rendering. However, you can:
use the new concurrent rendering features in React 18 — useDeferredValue(), startTransition(), and useTransition that can render without blocking the UI. React has their own scheduler that has similarities with what main-thread-scheduling is doing.
gradually render your results by calling setState() in React after each yieldOrContinue() call.
gradually render your results by calling setState() in React after each yieldOrContinue() call.
However, this needs to be done carefully, because React is able to batch state updates. If done blindly, yielding after each setState might produce more re-renders than needed (= worse performance ultimately).
This project is great, I would like to ask whether it can interrupt the rendering of react. For example, if there is a list of 10,000 length arrays and react updates this array when performing state updates, can it interrupt the rendering
The text was updated successfully, but these errors were encountered: