[JSX] Don't wrap JSX Elements in parentheses if they are inside JSX Expression Containers (#845)

This commit is contained in:
Alex Rattray authored and Christopher Chedeau committed 2017-03-01 12:05:57 -08:00
1 parent 198a9e4e49
commit 475208d22a
3 files changed
+23 -2

No files matched your search

+1
View File
@@ -2677,6 +2677,7 @@ function maybeWrapJSXElementInParens(path, elem, options) {
const NO_WRAP_PARENTS = {
JSXElement: true,
JSXExpressionContainer: true,
ExpressionStatement: true,
CallExpression: true,
ConditionalExpression: true,
+15 -1
View File
@@ -60,7 +60,13 @@ exports[`expression.js 1`] = `
this.props.veryBigItemImageViewFunc(option)}
heading={this.props.displayTextFunc(option)}
value={option}
/>
/>;
<ParentComponent prop={
<Child>
test
</Child>
}/>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<View
style={{
@@ -122,6 +128,14 @@ exports[`expression.js 1`] = `
heading={this.props.displayTextFunc(option)}
value={option}
/>;
<ParentComponent
prop={
<Child>
test
</Child>
}
/>;
"
`;
+7 -1
View File
@@ -57,4 +57,10 @@
this.props.veryBigItemImageViewFunc(option)}
heading={this.props.displayTextFunc(option)}
value={option}
/>
/>;
<ParentComponent prop={
<Child>
test
</Child>
}/>;