Skip to content

Commit

Permalink
Downcase attribute names in SSR diff hydration
Browse files Browse the repository at this point in the history
IE Edge reports some SVG attributes, like stroke and fill, in all
caps. This commit downcases all attribute names so that comparison
when diffing is case in-sensitive.
  • Loading branch information
nhunzaker committed Aug 7, 2017
1 parent ab5cdbe commit 338cc0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderers/dom/fiber/ReactDOMFiberComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,10 @@ var ReactDOMFiberComponent = {
var extraAttributeNames: Set<string> = new Set();
var attributes = domElement.attributes;
for (var i = 0; i < attributes.length; i++) {
// TODO: Do we need to lower case this to get case insensitive matches?
var name = attributes[i].name;
// Downcase to work around IE Edge, which reports some SVG attributes
// in all-caps. See:
// https://github.com/facebook/react/pull/10394#issuecomment-320523369
var name = attributes[i].name.toLowerCase();
switch (name) {
// Built-in attributes are whitelisted
// TODO: Once these are gone from the server renderer, we don't need
Expand Down

0 comments on commit 338cc0a

Please sign in to comment.