Skip to content

Commit

Permalink
Do not consider namespaces when checking for DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
yacinehmito committed May 9, 2020
1 parent b9d2eb5 commit 0fca9b0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/util/jsx.js
Expand Up @@ -14,15 +14,7 @@ const COMPAT_TAG_REGEX = /^[a-z]|-/;
* @returns {boolean} Whether or not the node corresponds to a DOM element.
*/
function isDOMComponent(node) {
let name = elementType(node);

// Get namespace if the type is JSXNamespacedName or JSXMemberExpression
if (name.indexOf(':') > -1) {
name = name.slice(0, name.indexOf(':'));
} else if (name.indexOf('.') > -1) {
name = name.slice(0, name.indexOf('.'));
}

const name = elementType(node);
return COMPAT_TAG_REGEX.test(name);
}

Expand Down

0 comments on commit 0fca9b0

Please sign in to comment.