Don't reuse same node for React.createElement

Is causing problems with path cache. See https://github.com/babel/babel/pull/3428
This commit is contained in:
Amjad Masad
2016-03-16 18:14:16 -07:00
parent 514d68770f
commit 3f4b88e638

View File

@@ -15,7 +15,7 @@ export default function ({ types: t }) {
},
post(state, pass) {
state.callee = pass.get("jsxIdentifier");
state.callee = pass.get("jsxIdentifier")();
}
});
@@ -35,9 +35,12 @@ export default function ({ types: t }) {
}
}
state.set("jsxIdentifier", id.split(".").map((name) => t.identifier(name)).reduce(function (object, property) {
return t.memberExpression(object, property);
}));
state.set(
"jsxIdentifier",
()=> id.split(".").map((name) => t.identifier(name)).reduce(
(object, property) => t.memberExpression(object, property)
)
);
};
return {