ESLint: Re-enable rule no-access-state-in-setstate (#10870)

* Re-enable rule no-access-state-in-setstate

* Move accessing event values out of async functions
This commit is contained in:
Kamil Gabryjelski
2020-09-21 08:48:23 +02:00
committed by GitHub
parent 3d8f757ac8
commit 4835d3b0a2
25 changed files with 83 additions and 71 deletions

View File

@@ -129,9 +129,9 @@ export default class ResultSet extends React.PureComponent<
}
toggleExploreResultsButton() {
this.setState({
showExploreResultsButton: !this.state.showExploreResultsButton,
});
this.setState(prevState => ({
showExploreResultsButton: !prevState.showExploreResultsButton,
}));
}
changeSearch(event: React.ChangeEvent<HTMLInputElement>) {