diff --git a/src/babel/pbfied.js b/src/babel/pbfied.js index 9c74b41..07d65ba 100644 --- a/src/babel/pbfied.js +++ b/src/babel/pbfied.js @@ -46,10 +46,11 @@ const pbfiedPlugin = ({ types: t }) => { }, JSXElement(path) { if (path.node.openingElement.name.name === "defs") { - path.replaceWithMultiple(path.node.children.filter(t.isJSXElement)); + // we gonna add them one after another, so we want to reverse the order to persist the order at the end + path.replaceInline(path.node.children.filter(t.isJSXElement)); } - if (path.node.openingElement.name.name === "use") { + if (t.isJSXIdentifier(path.node) && path.node.name.name === "use") { path.remove(); } },