add JSXAttribute visitor function, wraps JSXElement attributes in a JSXExpressionContainer; also adds test fixtures (#6006)
This commit is contained in:
@@ -47,6 +47,12 @@ export default function({ types: t }) {
|
||||
);
|
||||
};
|
||||
|
||||
visitor.JSXAttribute = function(path) {
|
||||
if (t.isJSXElement(path.node.value)) {
|
||||
path.node.value = t.jSXExpressionContainer(path.node.value);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
inherits: jsx,
|
||||
visitor,
|
||||
|
||||
Reference in New Issue
Block a user