diff --git a/src/printer.js b/src/printer.js index 93eaad2c8..52c1bb86e 100644 --- a/src/printer.js +++ b/src/printer.js @@ -2677,6 +2677,7 @@ function maybeWrapJSXElementInParens(path, elem, options) { const NO_WRAP_PARENTS = { JSXElement: true, + JSXExpressionContainer: true, ExpressionStatement: true, CallExpression: true, ConditionalExpression: true, diff --git a/tests/jsx/__snapshots__/jsfmt.spec.js.snap b/tests/jsx/__snapshots__/jsfmt.spec.js.snap index 9854a71fb..a48fda007 100644 --- a/tests/jsx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx/__snapshots__/jsfmt.spec.js.snap @@ -60,7 +60,13 @@ exports[`expression.js 1`] = ` this.props.veryBigItemImageViewFunc(option)} heading={this.props.displayTextFunc(option)} value={option} -/> +/>; + + + test + +}/>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; + + + test + + } +/>; " `; diff --git a/tests/jsx/expression.js b/tests/jsx/expression.js index 5e984414c..5dcf584ee 100644 --- a/tests/jsx/expression.js +++ b/tests/jsx/expression.js @@ -57,4 +57,10 @@ this.props.veryBigItemImageViewFunc(option)} heading={this.props.displayTextFunc(option)} value={option} -/> +/>; + + + test + +}/>;