Skip to content

Commit 5000470

Browse files
authored
Merge pull request #2630 from StoDevX/greenkeeper/eslint-plugin-react-7.9.1
Update eslint-plugin-react to the latest version [7.9.1] 🐋
2 parents 4b90014 + da0221c commit 5000470

File tree

9 files changed

+51
-44
lines changed

9 files changed

+51
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"eslint-config-prettier": "2.9.0",
145145
"eslint-plugin-babel": "5.1.0",
146146
"eslint-plugin-flowtype": "2.49.3",
147-
"eslint-plugin-react": "7.8.2",
147+
"eslint-plugin-react": "7.9.1",
148148
"eslint-plugin-react-native": "3.2.0",
149149
"flow-bin": "0.67.1",
150150
"jest": "23.1.0",

source/views/building-hours/row.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ function deriveStateFromProps(props: Props) {
7979
}
8080

8181
export class BuildingRow extends React.Component<Props, State> {
82+
state = deriveStateFromProps(this.props)
83+
8284
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
8385
if (prevState.now.isSame(nextProps.now, 'minute')) {
8486
return null
@@ -87,8 +89,6 @@ export class BuildingRow extends React.Component<Props, State> {
8789
return deriveStateFromProps(nextProps)
8890
}
8991

90-
state = deriveStateFromProps(this.props)
91-
9292
shouldComponentUpdate(nextProps: Props, nextState: State) {
9393
// We won't check the time in shouldComponentUpdate, because we really
9494
// only care if the building status has changed, and this is called after

source/views/building-hours/stateful-list.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ export class BuildingHoursView extends React.PureComponent<Props, State> {
5757
headerBackTitle: 'Hours',
5858
}
5959

60-
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
61-
return {
62-
buildings: groupBuildings(
63-
prevState.allBuildings,
64-
nextProps.favoriteBuildings,
65-
),
66-
}
67-
}
68-
6960
_intervalId: ?IntervalID
7061

7162
state = {
@@ -78,6 +69,15 @@ export class BuildingHoursView extends React.PureComponent<Props, State> {
7869
intervalId: null,
7970
}
8071

72+
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
73+
return {
74+
buildings: groupBuildings(
75+
prevState.allBuildings,
76+
nextProps.favoriteBuildings,
77+
),
78+
}
79+
}
80+
8181
componentDidMount() {
8282
this.fetchData()
8383

source/views/components/cells/textfield.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ type Props = {
4646
}
4747

4848
export class CellTextField extends React.Component<Props> {
49+
_input: any
50+
4951
static defaultProps = {
5052
disabled: false,
5153
placeholder: '',
@@ -55,7 +57,6 @@ export class CellTextField extends React.Component<Props> {
5557
autoCapitalize: 'none',
5658
}
5759

58-
_input: any
5960
focusInput = () => this._input.focus()
6061

6162
cacheRef = (ref: any) => {

source/views/components/datepicker/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,19 @@ type State = {
3333
}
3434

3535
export class DatePicker extends React.Component<Props, State> {
36+
_ref: any
37+
3638
static defaultProps = {
3739
mode: 'date',
3840
androidMode: 'default',
3941
onDateChange: () => null,
4042
}
4143

44+
state = {
45+
date: this.props.initialDate,
46+
timezone: this.props.initialDate.tz(),
47+
}
48+
4249
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
4350
if (nextProps.initialDate === prevState.date) {
4451
return null
@@ -50,13 +57,6 @@ export class DatePicker extends React.Component<Props, State> {
5057
}
5158
}
5259

53-
_ref: any
54-
55-
state = {
56-
date: this.props.initialDate,
57-
timezone: this.props.initialDate.tz(),
58-
}
59-
6060
formatDate = (date: moment) => {
6161
const {mode, format = FORMATS[mode]} = this.props
6262
return moment(date).format(format)

source/views/dictionary/report/editor.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export class DictionaryEditorView extends React.PureComponent<Props, State> {
2525
}
2626
}
2727

28+
state = {
29+
term: this.props.navigation.state.params.word.word,
30+
definition: this.props.navigation.state.params.word.definition,
31+
}
32+
2833
static getDerivedStateFromProps(nextProps: Props) {
2934
let entry = nextProps.navigation.state.params.word
3035
return {
@@ -33,11 +38,6 @@ export class DictionaryEditorView extends React.PureComponent<Props, State> {
3338
}
3439
}
3540

36-
state = {
37-
term: this.props.navigation.state.params.word.word,
38-
definition: this.props.navigation.state.params.word.definition,
39-
}
40-
4141
submit = () => {
4242
submitReport(this.props.navigation.state.params.word, {
4343
word: this.state.term,

source/views/sis/course-search/search.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ class CourseSearchView extends React.PureComponent<Props, State> {
154154
applyFilters: applyFiltersToItem,
155155
}
156156

157+
state = {
158+
browsing: false,
159+
cachedFilters: this.props.filters,
160+
dataLoading: true,
161+
searchResults: [],
162+
searchActive: false,
163+
searchPerformed: false,
164+
query: '',
165+
}
166+
157167
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
158168
if (prevState.browsing) {
159169
return applyFiltersAndQuery({
@@ -180,16 +190,6 @@ class CourseSearchView extends React.PureComponent<Props, State> {
180190
})
181191
}
182192

183-
state = {
184-
browsing: false,
185-
cachedFilters: this.props.filters,
186-
dataLoading: true,
187-
searchResults: [],
188-
searchActive: false,
189-
searchPerformed: false,
190-
query: '',
191-
}
192-
193193
componentDidMount() {
194194
areAnyTermsCached().then(anyTermsCached => {
195195
if (anyTermsCached) {

source/views/transportation/bus/line.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ function deriveFromProps({line, now}: Props) {
119119
}
120120

121121
export class BusLine extends React.Component<Props, State> {
122+
state = deriveFromProps(this.props)
123+
122124
static getDerivedStateFromProps(nextProps: Props) {
123125
return deriveFromProps(nextProps)
124126
}
125127

126-
state = deriveFromProps(this.props)
127-
128128
shouldComponentUpdate(nextProps: Props) {
129129
return (
130130
this.props.now.isSame(nextProps.now, 'minute') ||

yarn.lock

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ [email protected]:
22562256
version "2.1.0"
22572257
resolved "https://registry.yarnpkg.com/directory-tree/-/directory-tree-2.1.0.tgz#e0c1a66f625481aaf7d603741f0d3d93cdd4867a"
22582258

2259-
doctrine@^2.0.2, doctrine@^2.1.0:
2259+
doctrine@^2.1.0:
22602260
version "2.1.0"
22612261
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
22622262
dependencies:
@@ -2491,14 +2491,14 @@ eslint-plugin-react-native@^3.2.1:
24912491
dependencies:
24922492
eslint-plugin-react-native-globals "^0.1.1"
24932493

2494-
eslint-plugin-react@7.8.2:
2495-
version "7.8.2"
2496-
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.8.2.tgz#e95c9c47fece55d2303d1a67c9d01b930b88a51d"
2494+
eslint-plugin-react@7.9.1:
2495+
version "7.9.1"
2496+
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.9.1.tgz#101aadd15e7c7b431ed025303ac7b421a8e3dc15"
24972497
dependencies:
2498-
doctrine "^2.0.2"
2499-
has "^1.0.1"
2498+
doctrine "^2.1.0"
2499+
has "^1.0.2"
25002500
jsx-ast-utils "^2.0.1"
2501-
prop-types "^15.6.0"
2501+
prop-types "^15.6.1"
25022502

25032503
eslint-rule-composer@^0.3.0:
25042504
version "0.3.0"
@@ -3243,6 +3243,12 @@ has@^1.0.1:
32433243
dependencies:
32443244
function-bind "^1.0.2"
32453245

3246+
has@^1.0.2:
3247+
version "1.0.2"
3248+
resolved "https://registry.yarnpkg.com/has/-/has-1.0.2.tgz#1a64bfe4b52e67fb87b9822503d97c019fb6ba42"
3249+
dependencies:
3250+
function-bind "^1.1.1"
3251+
32463252
hawk@~6.0.2:
32473253
version "6.0.2"
32483254
resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"

0 commit comments

Comments
 (0)