diff --git a/lib/index.js b/lib/index.js index 43e10bc..d31088c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -312,11 +312,10 @@ export function buildJsx(tree, options) { const attribute = attributes[index] if (attribute.type === 'JSXSpreadAttribute') { - const {argument} = attribute - if (argument.type === 'ObjectExpression') { - fields.push(...argument.properties) + if (attribute.argument.type === 'ObjectExpression') { + fields.push(...attribute.argument.properties) } else { - fields.push({type: 'SpreadElement', argument}) + fields.push({type: 'SpreadElement', argument: attribute.argument}) } spread = true