[JSX] Don't wrap JSX Elements in parentheses if they are inside JSX Expression Containers (#845)
parent
198a9e4e49
commit
475208d22a
|
@ -2677,6 +2677,7 @@ function maybeWrapJSXElementInParens(path, elem, options) {
|
|||
|
||||
const NO_WRAP_PARENTS = {
|
||||
JSXElement: true,
|
||||
JSXExpressionContainer: true,
|
||||
ExpressionStatement: true,
|
||||
CallExpression: true,
|
||||
ConditionalExpression: true,
|
||||
|
|
|
@ -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>
|
||||
}
|
||||
/>;
|
||||
"
|
||||
`;
|
||||
|
||||
|
|
|
@ -57,4 +57,10 @@
|
|||
this.props.veryBigItemImageViewFunc(option)}
|
||||
heading={this.props.displayTextFunc(option)}
|
||||
value={option}
|
||||
/>
|
||||
/>;
|
||||
|
||||
<ParentComponent prop={
|
||||
<Child>
|
||||
test
|
||||
</Child>
|
||||
}/>;
|
||||
|
|
Loading…
Reference in New Issue