File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,18 @@ const defaultMethodsOrder = [
117
117
'state' ,
118
118
'getInitialState' ,
119
119
'getChildContext' ,
120
+ 'getDerivedStateFromProps' ,
120
121
'componentWillMount' ,
122
+ 'UNSAFE_componentWillMount' ,
121
123
'componentDidMount' ,
122
124
'componentWillReceiveProps' ,
125
+ 'UNSAFE_componentWillReceiveProps' ,
123
126
'shouldComponentUpdate' ,
124
127
'componentWillUpdate' ,
128
+ 'UNSAFE_componentWillUpdate' ,
129
+ 'getSnapshotBeforeUpdate' ,
125
130
'componentDidUpdate' ,
131
+ 'componentDidCatch' ,
126
132
'componentWillUnmount' ,
127
133
'/^on.+$/' ,
128
134
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/' ,
@@ -135,6 +141,12 @@ const defaultMethodsOrder = [
135
141
const regExpRegExp = / \/ ( .* ) \/ ( [ g | y | i | m ] * ) / ;
136
142
137
143
function selectorMatches ( selector , method ) {
144
+ const methodName = method . key . name ;
145
+
146
+ if ( ( method . static && selector === 'static-methods' ) && defaultMethodsOrder . indexOf ( methodName ) === - 1 ) {
147
+ return true ;
148
+ }
149
+
138
150
if ( ! method . value && method . typeAnnotation && selector === 'type-annotations' ) {
139
151
return true ;
140
152
}
@@ -143,8 +155,6 @@ function selectorMatches(selector, method) {
143
155
return true ;
144
156
}
145
157
146
- const methodName = method . key . name ;
147
-
148
158
if ( selector === methodName ) {
149
159
return true ;
150
160
}
You can’t perform that action at this time.
0 commit comments