Skip to content

Commit 7e46974

Browse files
committed
Hide unhandled rejections
1 parent 29e1169 commit 7e46974

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react/src/ReactLazy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {enableAsyncDebugInfo} from 'shared/ReactFeatureFlags';
2020

2121
import {REACT_LAZY_TYPE} from 'shared/ReactSymbols';
2222

23+
import noop from 'shared/noop';
24+
2325
const Uninitialized = -1;
2426
const Pending = 0;
2527
const Resolved = 1;
@@ -140,6 +142,8 @@ function lazyInitializer<T>(payload: Payload<T>): T {
140142
// Mark the end time of when we rejected.
141143
// $FlowFixMe[cannot-write]
142144
ioInfo.end = performance.now();
145+
// Hide unhandled rejections.
146+
ioInfo.value.then(noop, noop);
143147
rejectDebugValue(error);
144148
// $FlowFixMe
145149
ioInfo.value.status = 'rejected';

0 commit comments

Comments
 (0)