Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa6205d

Browse files
authored
Special case crossOrigin for SVG image elements (facebook#14832)
1 parent c6bee76 commit fa6205d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/react-dom/src/shared/DOMProperty.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,15 @@ const capitalize = token => token[1].toUpperCase();
525525
);
526526
});
527527

528-
// Special case: this attribute exists both in HTML and SVG.
529-
// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use
530-
// its React `tabIndex` name, like we do for attributes that exist only in HTML.
531-
properties.tabIndex = new PropertyInfoRecord(
532-
'tabIndex',
533-
STRING,
534-
false, // mustUseProperty
535-
'tabindex', // attributeName
536-
null, // attributeNamespace
537-
);
528+
// These attribute exists both in HTML and SVG.
529+
// The attribute name is case-sensitive in SVG so we can't just use
530+
// the React name like we do for attributes that exist only in HTML.
531+
['tabIndex', 'crossOrigin'].forEach(attributeName => {
532+
properties[attributeName] = new PropertyInfoRecord(
533+
attributeName,
534+
STRING,
535+
false, // mustUseProperty
536+
attributeName.toLowerCase(), // attributeName
537+
null, // attributeNamespace
538+
);
539+
});

0 commit comments

Comments
 (0)