From 108ad51650f2a3bebe2a912ac6513b1205ae9ca4 Mon Sep 17 00:00:00 2001 From: Brandon Dail Date: Sun, 11 Mar 2018 20:27:34 -0700 Subject: [PATCH] Initialize React prop name/attribute name mapping without Map Using `new Map(iterable)` isn't supported in IE11, so it ends up trying to iterate through an empty map and these attributes don't get defined in properties. Since this is only run once on startup inlining the attributeName array is probably fine. --- packages/react-dom/src/shared/DOMProperty.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/shared/DOMProperty.js b/packages/react-dom/src/shared/DOMProperty.js index cd88c0223db3..dd2c8f6e3a42 100644 --- a/packages/react-dom/src/shared/DOMProperty.js +++ b/packages/react-dom/src/shared/DOMProperty.js @@ -224,12 +224,12 @@ const properties = {}; // A few React string attributes have a different name. // This is a mapping from React prop names to the attribute names. -new Map([ +[ ['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv'], -]).forEach((attributeName, name) => { +].forEach(([name, attributeName]) => { properties[name] = new PropertyInfoRecord( name, STRING,