Move lazy._result assignment (#14632)
Dan Abramov committed
Jan 18, 2019 at 21:57 UTC
a2fa6eb98d11fd1b41a144fd600a14a722c7546e
1 file changed
+1
-1
packages/react-reconciler/src/ReactFiberLazyComponent.js
+1
-1
@@ -47,7 +47,6 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
47
lazyComponent._status = Pending;
48
const ctor = lazyComponent._ctor;
49
const thenable = ctor();
50
- lazyComponent._result = thenable;
50
thenable.then(
51
moduleObject => {
52
if (lazyComponent._status === Pending) {
@@ -78,6 +77,7 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
77
if (lazyComponent._status === Resolved) {
78
return lazyComponent._result;
79
}
80
+ lazyComponent._result = thenable;
81
throw thenable;
82
}
83
}