diff --git a/src/diff/index.js b/src/diff/index.js index 3a78f31b30..d97abea6fa 100644 --- a/src/diff/index.js +++ b/src/diff/index.js @@ -403,15 +403,15 @@ function diffElementNodes( return document.createTextNode(newProps); } - if (namespace == 2) { - dom = document.createElementNS('http://www.w3.org/2000/svg', nodeType); - } else if (namespace == 3) { + if (namespace == 1) { + dom = document.createElement(nodeType, newProps.is && newProps); + } else { dom = document.createElementNS( - 'http://www.w3.org/1998/Math/MathML', + namespace == 2 + ? 'http://www.w3.org/2000/svg' + : 'http://www.w3.org/1998/Math/MathML', nodeType ); - } else { - dom = document.createElement(nodeType, newProps.is && newProps); } // we created a new parent, so none of the previously attached children can be reused: