Skip to content

Commit 480e41f

Browse files
committed
Downcase attribute names in SSR diff hydration
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.
1 parent ab5cdbe commit 480e41f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/renderers/dom/fiber/ReactDOMFiberComponent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,9 @@ var ReactDOMFiberComponent = {
928928
var extraAttributeNames: Set<string> = new Set();
929929
var attributes = domElement.attributes;
930930
for (var i = 0; i < attributes.length; i++) {
931-
// TODO: Do we need to lower case this to get case insensitive matches?
932-
var name = attributes[i].name;
931+
// Downcase because IE Edge some SVG attributes in all caps. See:
932+
// https://github.com/facebook/react/pull/10394#issuecomment-320523369
933+
var name = attributes[i].name.toLowerCase();
933934
switch (name) {
934935
// Built-in attributes are whitelisted
935936
// TODO: Once these are gone from the server renderer, we don't need

0 commit comments

Comments
 (0)