Avoid new Set([iterable]) for thenables (#14592)
Fixes https://github.com/facebook/react/issues/14583 Using `new Set([iterable])` does not work with IE11's non-compliant Set implementation. By avoiding this pattern we don't need to require a Set polyfill for IE11
Brandon Dail committed
Jan 14, 2019 at 17:00 UTC
0fc15475139206f1f999b5c16bbe6f90142e936a
1 file changed
+2
-1
packages/react-reconciler/src/ReactFiberUnwindWork.js
+2
-1
@@ -214,7 +214,8 @@ function throwException(
214
// attach another listener to flip the boundary back to its normal state.
215
const thenables: Set<Thenable> = (workInProgress.updateQueue: any);
216
if (thenables === null) {
217
- workInProgress.updateQueue = (new Set([thenable]): any);
217
+ workInProgress.updateQueue = (new Set(): any);
218
+ workInProgress.updateQueue.add(thenable);
219
} else {
220
thenables.add(thenable);
221
}