@@ -230,7 +230,6 @@ function updateForwardRef(
230
230
nextChildren ,
231
231
renderExpirationTime ,
232
232
) ;
233
- memoizeProps ( workInProgress , nextProps ) ;
234
233
return workInProgress . child ;
235
234
}
236
235
@@ -282,7 +281,6 @@ function updatePureComponent(
282
281
nextChildren ,
283
282
renderExpirationTime ,
284
283
) ;
285
- memoizeProps ( workInProgress , nextProps ) ;
286
284
return workInProgress . child ;
287
285
}
288
286
@@ -298,7 +296,6 @@ function updateFragment(
298
296
nextChildren ,
299
297
renderExpirationTime ,
300
298
) ;
301
- memoizeProps ( workInProgress , nextChildren ) ;
302
299
return workInProgress . child ;
303
300
}
304
301
@@ -314,7 +311,6 @@ function updateMode(
314
311
nextChildren ,
315
312
renderExpirationTime ,
316
313
) ;
317
- memoizeProps ( workInProgress , nextChildren ) ;
318
314
return workInProgress . child ;
319
315
}
320
316
@@ -334,7 +330,6 @@ function updateProfiler(
334
330
nextChildren ,
335
331
renderExpirationTime ,
336
332
) ;
337
- memoizeProps ( workInProgress , nextProps ) ;
338
333
return workInProgress . child ;
339
334
}
340
335
@@ -378,7 +373,6 @@ function updateFunctionComponent(
378
373
nextChildren ,
379
374
renderExpirationTime ,
380
375
) ;
381
- memoizeProps ( workInProgress , nextProps ) ;
382
376
return workInProgress . child ;
383
377
}
384
378
@@ -539,10 +533,9 @@ function finishClassComponent(
539
533
) ;
540
534
}
541
535
542
- // Memoize props and state using the values we just used to render.
536
+ // Memoize state using the values we just used to render.
543
537
// TODO: Restructure so we never read values from the instance.
544
- memoizeState ( workInProgress , instance . state ) ;
545
- memoizeProps ( workInProgress , instance . props ) ;
538
+ workInProgress . memoizedState = instance . state ;
546
539
547
540
// The context might have changed so we need to recalculate it.
548
541
if ( hasContext ) {
@@ -676,7 +669,6 @@ function updateHostComponent(current, workInProgress, renderExpirationTime) {
676
669
) {
677
670
// Schedule this fiber to re-render at offscreen priority. Then bailout.
678
671
workInProgress . expirationTime = Never ;
679
- workInProgress . memoizedProps = nextProps ;
680
672
return null ;
681
673
}
682
674
@@ -686,16 +678,13 @@ function updateHostComponent(current, workInProgress, renderExpirationTime) {
686
678
nextChildren ,
687
679
renderExpirationTime ,
688
680
) ;
689
- memoizeProps ( workInProgress , nextProps ) ;
690
681
return workInProgress . child ;
691
682
}
692
683
693
684
function updateHostText ( current , workInProgress ) {
694
685
if ( current === null ) {
695
686
tryToClaimNextHydratableInstance ( workInProgress ) ;
696
687
}
697
- const nextProps = workInProgress . pendingProps ;
698
- memoizeProps ( workInProgress , nextProps ) ;
699
688
// Nothing to do here. This is terminal. We'll do the completion step
700
689
// immediately after.
701
690
return null ;
@@ -805,7 +794,6 @@ function mountIndeterminateComponent(
805
794
) ;
806
795
}
807
796
}
808
- workInProgress . memoizedProps = props ;
809
797
return child ;
810
798
}
811
799
@@ -954,7 +942,6 @@ function mountIndeterminateComponent(
954
942
}
955
943
}
956
944
reconcileChildren ( null , workInProgress , value , renderExpirationTime ) ;
957
- memoizeProps ( workInProgress , props ) ;
958
945
return workInProgress . child ;
959
946
}
960
947
}
@@ -1165,7 +1152,6 @@ function updateSuspenseComponent(
1165
1152
}
1166
1153
}
1167
1154
1168
- workInProgress . memoizedProps = nextProps ;
1169
1155
workInProgress . memoizedState = nextState ;
1170
1156
workInProgress . child = child ;
1171
1157
return next ;
@@ -1190,15 +1176,13 @@ function updatePortalComponent(
1190
1176
nextChildren ,
1191
1177
renderExpirationTime ,
1192
1178
) ;
1193
- memoizeProps ( workInProgress , nextChildren ) ;
1194
1179
} else {
1195
1180
reconcileChildren (
1196
1181
current ,
1197
1182
workInProgress ,
1198
1183
nextChildren ,
1199
1184
renderExpirationTime ,
1200
1185
) ;
1201
- memoizeProps ( workInProgress , nextChildren ) ;
1202
1186
}
1203
1187
return workInProgress . child ;
1204
1188
}
@@ -1215,7 +1199,6 @@ function updateContextProvider(
1215
1199
const oldProps = workInProgress.memoizedProps;
1216
1200
1217
1201
const newValue = newProps.value;
1218
- workInProgress.memoizedProps = newProps;
1219
1202
1220
1203
if (__DEV__) {
1221
1204
const providerPropTypes = workInProgress . type . propTypes ;
@@ -1327,7 +1310,6 @@ function updateContextConsumer(
1327
1310
// React DevTools reads this flag.
1328
1311
workInProgress . effectTag |= PerformedWork ;
1329
1312
reconcileChildren ( current , workInProgress , newChildren , renderExpirationTime ) ;
1330
- workInProgress . memoizedProps = newProps ;
1331
1313
return workInProgress . child ;
1332
1314
}
1333
1315
@@ -1385,17 +1367,6 @@ function bailoutOnAlreadyFinishedWork(
1385
1367
}
1386
1368
}
1387
1369
1388
- // TODO: Delete memoizeProps/State and move to reconcile/bailout instead
1389
- function memoizeProps ( workInProgress : Fiber , nextProps : any ) {
1390
- workInProgress . memoizedProps = nextProps ;
1391
- }
1392
-
1393
- function memoizeState ( workInProgress : Fiber , nextState : any ) {
1394
- workInProgress . memoizedState = nextState ;
1395
- // Don't reset the updateQueue, in case there are pending updates. Resetting
1396
- // is handled by processUpdateQueue.
1397
- }
1398
-
1399
1370
function beginWork (
1400
1371
current : Fiber | null ,
1401
1372
workInProgress : Fiber ,
@@ -1517,7 +1488,6 @@ function beginWork(
1517
1488
resolveDefaultProps ( Component , unresolvedProps ) ,
1518
1489
renderExpirationTime ,
1519
1490
) ;
1520
- workInProgress . memoizedProps = unresolvedProps ;
1521
1491
return child ;
1522
1492
}
1523
1493
case ClassComponent : {
@@ -1542,7 +1512,6 @@ function beginWork(
1542
1512
resolveDefaultProps ( Component , unresolvedProps ) ,
1543
1513
renderExpirationTime ,
1544
1514
) ;
1545
- workInProgress . memoizedProps = unresolvedProps ;
1546
1515
return child ;
1547
1516
}
1548
1517
case HostRoot :
@@ -1584,7 +1553,6 @@ function beginWork(
1584
1553
resolveDefaultProps ( Component , unresolvedProps ) ,
1585
1554
renderExpirationTime ,
1586
1555
) ;
1587
- workInProgress . memoizedProps = unresolvedProps ;
1588
1556
return child ;
1589
1557
}
1590
1558
case Fragment :
@@ -1628,7 +1596,6 @@ function beginWork(
1628
1596
updateExpirationTime ,
1629
1597
renderExpirationTime ,
1630
1598
) ;
1631
- workInProgress . memoizedProps = unresolvedProps ;
1632
1599
return child ;
1633
1600
}
1634
1601
default :
0 commit comments