Skip to content

Commit

Permalink
Don't treat JSXIdentifier in JSXMemberExpression as HTML tag. Closes b…
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewML authored and panagosg7 committed Jan 17, 2017
1 parent f7728be commit 0af0697
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
@@ -0,0 +1,6 @@
//index.js file
import { form } from "./export";

function ParentComponent() {
return <form.TestComponent />;
}
@@ -0,0 +1,7 @@
"use strict";

var _export = require("./export");

function ParentComponent() {
return babelHelpers.jsx(_export.form.TestComponent, {});
} //index.js file
@@ -0,0 +1,9 @@
{
"plugins": [
"external-helpers",
"syntax-jsx",
"transform-react-inline-elements",
"transform-react-jsx",
"transform-es2015-modules-commonjs"
]
}
2 changes: 1 addition & 1 deletion packages/babel-traverse/src/path/lib/virtual-types.js
Expand Up @@ -5,7 +5,7 @@ import * as t from "babel-types";
export let ReferencedIdentifier = {
types: ["Identifier", "JSXIdentifier"],
checkPath({ node, parent }: NodePath, opts?: Object): boolean {
if (!t.isIdentifier(node, opts)) {
if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
if (t.isJSXIdentifier(node, opts)) {
if (react.isCompatTag(node.name)) return false;
} else {
Expand Down

0 comments on commit 0af0697

Please sign in to comment.