Merge pull request #3430 from babel/dont-reuse-react
Don't reuse same node for React.createElement
This commit is contained in:
commit
a42d57ea81
@ -15,7 +15,7 @@ export default function ({ types: t }) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
post(state, pass) {
|
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) {
|
state.set(
|
||||||
return t.memberExpression(object, property);
|
"jsxIdentifier",
|
||||||
}));
|
() => id.split(".").map((name) => t.identifier(name)).reduce(
|
||||||
|
(object, property) => t.memberExpression(object, property)
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user