Transform JSX spread children (#45693)

* Transform JSX spread children

* Target es2015 to skip helper and refine emit

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Orta <git@orta.io>
This commit is contained in:
Jack Bates
2021-09-24 09:19:49 -07:00
committed by GitHub
parent af689cc5d5
commit 27bbdf1fe9
11 changed files with 335 additions and 15 deletions

View File

@@ -547,7 +547,8 @@ namespace ts {
}
function visitJsxExpression(node: JsxExpression) {
return visitNode(node.expression, visitor, isExpression);
const expression = visitNode(node.expression, visitor, isExpression);
return node.dotDotDotToken ? factory.createSpreadElement(expression!) : expression;
}
}