Skip to content

Commit

Permalink
Move lazy._result assignment (#14632)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Jan 18, 2019
1 parent 9120f6c commit a2fa6eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberLazyComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
lazyComponent._status = Pending;
const ctor = lazyComponent._ctor;
const thenable = ctor();
lazyComponent._result = thenable;
thenable.then(
moduleObject => {
if (lazyComponent._status === Pending) {
Expand Down Expand Up @@ -78,6 +77,7 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
if (lazyComponent._status === Resolved) {
return lazyComponent._result;
}
lazyComponent._result = thenable;
throw thenable;
}
}
Expand Down

0 comments on commit a2fa6eb

Please sign in to comment.