dillon1000/react

Commit

use: Don't suspend if there are pending updates

Before suspending, check if there are other pending updates that might
possibly unblock the suspended component. If so, interrupt the current
render and switch to working on that.

This logic was already implemented for the old "throw a Promise"
Suspense but has to be replicated for `use` because it suspends the
work loop much earlier.

I'm getting a little anxious about the divergence between the two
Suspense patterns. I'm going to look into enabling the new behavior for
the old pattern so that we can unify the implementations.
Browse files
Changed paths3 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/__tests__/ReactThenable-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…