File tree 1 file changed +2
-26
lines changed
packages/react-hooks/src/__tests__
1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -205,18 +205,6 @@ describe('useSubscription', () => {
205
205
}
206
206
207
207
class Parent extends React . Component {
208
- state = { } ;
209
-
210
- static getDerivedStateFromProps ( nextProps , prevState ) {
211
- if ( nextProps . observed !== prevState . observed ) {
212
- return {
213
- observed : nextProps . observed ,
214
- } ;
215
- }
216
-
217
- return null ;
218
- }
219
-
220
208
componentDidMount ( ) {
221
209
log . push ( 'Parent.componentDidMount' ) ;
222
210
}
@@ -226,7 +214,7 @@ describe('useSubscription', () => {
226
214
}
227
215
228
216
render ( ) {
229
- return < Subscription source = { this . state . observed } /> ;
217
+ return < Subscription source = { this . props . observed } /> ;
230
218
}
231
219
}
232
220
@@ -299,18 +287,6 @@ describe('useSubscription', () => {
299
287
}
300
288
301
289
class Parent extends React . Component {
302
- state = { } ;
303
-
304
- static getDerivedStateFromProps ( nextProps , prevState ) {
305
- if ( nextProps . observed !== prevState . observed ) {
306
- return {
307
- observed : nextProps . observed ,
308
- } ;
309
- }
310
-
311
- return null ;
312
- }
313
-
314
290
componentDidMount ( ) {
315
291
log . push ( 'Parent.componentDidMount' ) ;
316
292
}
@@ -320,7 +296,7 @@ describe('useSubscription', () => {
320
296
}
321
297
322
298
render ( ) {
323
- return < Subscription source = { this . state . observed } /> ;
299
+ return < Subscription source = { this . props . observed } /> ;
324
300
}
325
301
}
326
302
You can’t perform that action at this time.
0 commit comments