File tree Expand file tree Collapse file tree 1 file changed +2
-26
lines changed
packages/react-hooks/src/__tests__ Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -205,18 +205,6 @@ describe('useSubscription', () => {
205205 }
206206
207207 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-
220208 componentDidMount ( ) {
221209 log . push ( 'Parent.componentDidMount' ) ;
222210 }
@@ -226,7 +214,7 @@ describe('useSubscription', () => {
226214 }
227215
228216 render ( ) {
229- return < Subscription source = { this . state . observed } /> ;
217+ return < Subscription source = { this . props . observed } /> ;
230218 }
231219 }
232220
@@ -299,18 +287,6 @@ describe('useSubscription', () => {
299287 }
300288
301289 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-
314290 componentDidMount ( ) {
315291 log . push ( 'Parent.componentDidMount' ) ;
316292 }
@@ -320,7 +296,7 @@ describe('useSubscription', () => {
320296 }
321297
322298 render ( ) {
323- return < Subscription source = { this . state . observed } /> ;
299+ return < Subscription source = { this . props . observed } /> ;
324300 }
325301 }
326302
You can’t perform that action at this time.
0 commit comments