Skip to content

Commit a2fa6eb

Browse files
authored
Move lazy._result assignment (#14632)
1 parent 9120f6c commit a2fa6eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-reconciler/src/ReactFiberLazyComponent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
4747
lazyComponent._status = Pending;
4848
const ctor = lazyComponent._ctor;
4949
const thenable = ctor();
50-
lazyComponent._result = thenable;
5150
thenable.then(
5251
moduleObject => {
5352
if (lazyComponent._status === Pending) {
@@ -78,6 +77,7 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
7877
if (lazyComponent._status === Resolved) {
7978
return lazyComponent._result;
8079
}
80+
lazyComponent._result = thenable;
8181
throw thenable;
8282
}
8383
}

0 commit comments

Comments
 (0)