Skip to content

Commit c52e7eb

Browse files
[babel] Fix issue with transform-react-inline-elements
1 parent 4bd3924 commit c52e7eb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/index.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
module.exports = function() {
44
return {
55
visitor: {
6-
JSXIdentifier: function(path) {
7-
if (path.node.name === 'data-test') {
8-
path.parentPath.remove();
9-
}
10-
},
6+
Program(path) {
7+
// On program start, do an explicit traversal up front for your plugin.
8+
path.traverse({
9+
JSXIdentifier: function(path) {
10+
if (path.node.name === 'data-test') {
11+
path.parentPath.remove();
12+
}
13+
},
14+
});
15+
}
1116
},
1217
};
1318
};

0 commit comments

Comments
 (0)