[class-properties] Remove unnecessary return and temp variable (#8123)
* Remove unnecessary temp variable * Update tests
This commit is contained in:
@@ -6,17 +6,19 @@ var _ref =
|
||||
|
||||
class BugReport extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
super(...args);
|
||||
|
||||
return _temp = super(...args), this.thisWontWork = ({
|
||||
this.thisWontWork = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>does not reference data</div>;
|
||||
}, this.thisWorks = ({
|
||||
};
|
||||
|
||||
this.thisWorks = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>{data}</div>;
|
||||
}, _temp;
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -4,13 +4,15 @@ var _ref =
|
||||
|
||||
class Component extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
super(...args);
|
||||
|
||||
this.subComponent = () => _ref;
|
||||
|
||||
var _ref2 =
|
||||
/*#__PURE__*/
|
||||
<this.subComponent />;
|
||||
|
||||
return _temp = super(...args), this.subComponent = () => _ref, this.render = () => _ref2, _temp;
|
||||
this.render = () => _ref2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ var _ref2 =
|
||||
|
||||
class Component extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
super(...args);
|
||||
|
||||
return _temp = super(...args), this.render = () => _ref2, _temp;
|
||||
this.render = () => _ref2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user