Skip to content

Commit 0558696

Browse files
awearyjetoneza
authored andcommitted
Avoid new Set([iterable]) for thenables (facebook#14592)
Fixes facebook#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 de314d4 commit 0558696

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-reconciler/src/ReactFiberUnwindWork.js

Lines changed: 2 additions & 1 deletion
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)