dillon1000/react

Commit

Partial support for React.lazy() in server renderer. (#16383)

Provides partial support for React.lazy() components from the existing PartialRenderer server-side renderer.

Lazy components which are already resolved (or rejected), perhaps with something like `react-ssr-prepass`, can be continued into synchronously. If they have not yet been initialized, they'll be initialized before checking, opening the possibility to exploit this capability with a babel transform. If they're pending (which will typically be the case for a just initialized async ctor) then the existing invariant continues to be thrown.
Browse files
Changed paths4 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactServerRendering-test.js ModifiedM packages/react-dom/src/server/ReactPartialRenderer.js ModifiedM packages/react-reconciler/src/ReactFiberLazyComponent.js ModifiedM packages/shared/ReactLazyComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…