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.
This commit is contained in:
Brandon Dail 2018-03-12 10:42:17 -07:00 committed by Dan Abramov
parent fcc4f52cdd
commit 280acbcb71
1 changed files with 2 additions and 2 deletions

View File

@ -224,12 +224,12 @@ const properties = {};
// A few React string attributes have a different name. // A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names. // This is a mapping from React prop names to the attribute names.
new Map([ [
['acceptCharset', 'accept-charset'], ['acceptCharset', 'accept-charset'],
['className', 'class'], ['className', 'class'],
['htmlFor', 'for'], ['htmlFor', 'for'],
['httpEquiv', 'http-equiv'], ['httpEquiv', 'http-equiv'],
]).forEach((attributeName, name) => { ].forEach(([name, attributeName]) => {
properties[name] = new PropertyInfoRecord( properties[name] = new PropertyInfoRecord(
name, name,
STRING, STRING,