Re-enable rule state-in-constructor (#10873)

This commit is contained in:
Kamil Gabryjelski 2020-09-14 22:31:11 +02:00 committed by GitHub
parent 767044bfe5
commit 91b8c8afc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -125,7 +125,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
},
@ -239,7 +238,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // disabled temporarily
'prettier/prettier': 'error',
},

View File

@ -92,11 +92,14 @@ class DashboardTable extends React.PureComponent<
initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
state = {
constructor(props: DashboardTableProps) {
super(props);
this.state = {
dashboards: [],
dashboard_count: 0,
loading: false,
};
}
componentDidUpdate(prevProps: DashboardTableProps) {
if (prevProps.search !== this.props.search) {