[class-properties] Remove unnecessary return and temp variable (#8123)

* Remove unnecessary temp variable

* Update tests
This commit is contained in:
Nicolò Ribaudo
2018-06-08 07:02:36 +02:00
committed by GitHub
parent 415d79bdfe
commit 9f4e2f81d8
14 changed files with 68 additions and 29 deletions

View File

@@ -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() {

View File

@@ -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;
}
}

View File

@@ -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;
}
}