Initialize React prop name/attribute name mapping without Map (#12353)
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.
Brandon Dail committed
Mar 12, 2018 at 10:42 UTC
280acbcb713fe0751c6230b94efb45376eb4af67
1 file changed
+2
-2
packages/react-dom/src/shared/DOMProperty.js
+2
-2
@@ -224,12 +224,12 @@ const properties = {};
224
225
// A few React string attributes have a different name.
226
// This is a mapping from React prop names to the attribute names.
227
-new Map([
227
+[
228
['acceptCharset', 'accept-charset'],
229
['className', 'class'],
230
['htmlFor', 'for'],
231
['httpEquiv', 'http-equiv'],
232
-]).forEach((attributeName, name) => {
232
+].forEach(([name, attributeName]) => {
233
properties[name] = new PropertyInfoRecord(
234
name,
235
STRING,