mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
fix lint error - getDerivedStateFromProps should be placed after state (#3391)
This commit is contained in:
parent
807e6aaaa6
commit
b0a11983fa
@ -35,6 +35,12 @@ export class TimeAgo extends React.PureComponent {
|
||||
autoUpdate: true,
|
||||
};
|
||||
|
||||
// Initial state, to get rid of React warning
|
||||
state = {
|
||||
title: null,
|
||||
value: null,
|
||||
};
|
||||
|
||||
static getDerivedStateFromProps({ date, placeholder }) {
|
||||
// if `date` prop is not empty and a valid date/time - convert it to `moment`
|
||||
date = !isNil(date) ? moment(date) : null;
|
||||
@ -46,12 +52,6 @@ export class TimeAgo extends React.PureComponent {
|
||||
};
|
||||
}
|
||||
|
||||
// Initial state, to get rid of React warning
|
||||
state = {
|
||||
title: null,
|
||||
value: null,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
autoUpdateList.add(this);
|
||||
this.update(true);
|
||||
|
Loading…
Reference in New Issue
Block a user