Skip to content

Commit 0fc1547

Browse files
awearygaearon
authored andcommitted
Avoid new Set([iterable]) for thenables (#14592)
Fixes #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
1 parent edb1f59 commit 0fc1547

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: packages/react-reconciler/src/ReactFiberUnwindWork.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ function throwException(
214214
// attach another listener to flip the boundary back to its normal state.
215215
const thenables: Set<Thenable> = (workInProgress.updateQueue: any);
216216
if (thenables === null) {
217-
workInProgress.updateQueue = (new Set([thenable]): any);
217+
workInProgress.updateQueue = (new Set(): any);
218+
workInProgress.updateQueue.add(thenable);
218219
} else {
219220
thenables.add(thenable);
220221
}

0 commit comments

Comments
 (0)