diff --git a/index.js b/index.js index e0746b9..7ac911d 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,9 @@ module.exports = function (babel) { // turn tag into createElement call var callExpr = buildElementCall(path.get('openingElement'), file) // add children array as 3rd arg - callExpr.arguments.push(t.arrayExpression(path.node.children)) + if (path.node.children.length > 0) { + callExpr.arguments.push(t.arrayExpression(path.node.children)) + } if (callExpr.arguments.length >= 3) { callExpr._prettyCall = true }