From bf7479678d264ccad809f379878b9da59273941f Mon Sep 17 00:00:00 2001 From: Brandon Dail Date: Mon, 14 Jan 2019 16:35:42 -0800 Subject: [PATCH] Avoid new Set([iterable]) for thenables 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 --- packages/react-reconciler/src/ReactFiberUnwindWork.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/ReactFiberUnwindWork.js b/packages/react-reconciler/src/ReactFiberUnwindWork.js index 86e2b1a964a..f8c0b050f04 100644 --- a/packages/react-reconciler/src/ReactFiberUnwindWork.js +++ b/packages/react-reconciler/src/ReactFiberUnwindWork.js @@ -214,7 +214,8 @@ function throwException( // attach another listener to flip the boundary back to its normal state. const thenables: Set = (workInProgress.updateQueue: any); if (thenables === null) { - workInProgress.updateQueue = (new Set([thenable]): any); + workInProgress.updateQueue = (new Set(): any); + workInProgress.updateQueue.add(thenable); } else { thenables.add(thenable); }