Revert "Fix react/no-access-state-in-setstate errors. (#680)" (#683)

This reverts commit b61c89a87c.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2020-04-25 21:58:08 +03:00
committed by GitHub
parent ade0a39fac
commit 6d5052d64b
3 changed files with 3 additions and 8 deletions
+1 -4
View File
@@ -96,12 +96,9 @@
},
"eslintConfig": {
"root": true,
"extends": [
"react-app"
],
"extends": ["react-app"],
"rules": {
"react/display-name": "off",
"react/no-access-state-in-setstate": "error",
"react/prop-types": "off"
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ class ForgotPassword extends Component<
* Handle collapsing the body when clicked
*/
onClick = () => {
this.setState(prevState => ({ collapsed: !prevState.collapsed }));
this.setState({ collapsed: !this.state.collapsed });
};
/**
+1 -3
View File
@@ -48,9 +48,7 @@ class VersionCard extends Component<VersionCardProps, VersionCardState> {
<button
className="btn btn-secondary"
type="button"
onClick={() =>
this.setState(prevState => ({ collapsed: !prevState.collapsed }))
}
onClick={() => this.setState({ collapsed: !this.state.collapsed })}
>
{t("Details")}
</button>