@@ -31,8 +31,6 @@ import type {
31
31
import { NotPending } from 'react-dom-bindings/src/shared/ReactDOMFormActions' ;
32
32
import { getCurrentRootHostContainer } from 'react-reconciler/src/ReactFiberHostContext' ;
33
33
import { DefaultEventPriority } from 'react-reconciler/src/ReactEventPriorities' ;
34
- // TODO: Remove this deep import when we delete the legacy root API
35
- import { ConcurrentMode , NoMode } from 'react-reconciler/src/ReactTypeOfMode' ;
36
34
37
35
import hasOwnProperty from 'shared/hasOwnProperty' ;
38
36
import { checkAttributeStringCoercion } from 'shared/CheckStringCoercion' ;
@@ -1381,19 +1379,7 @@ export function hydrateInstance(
1381
1379
// get attached.
1382
1380
updateFiberProps ( instance , props ) ;
1383
1381
1384
- // TODO: Temporary hack to check if we're in a concurrent root. We can delete
1385
- // when the legacy root API is removed.
1386
- const isConcurrentMode =
1387
- ( ( internalInstanceHandle : Fiber ) . mode & ConcurrentMode ) !== NoMode ;
1388
-
1389
- diffHydratedProperties (
1390
- instance ,
1391
- type ,
1392
- props ,
1393
- isConcurrentMode ,
1394
- shouldWarnDev ,
1395
- hostContext ,
1396
- ) ;
1382
+ diffHydratedProperties ( instance , type , props , shouldWarnDev , hostContext ) ;
1397
1383
}
1398
1384
1399
1385
export function validateHydratableTextInstance (
@@ -1418,12 +1404,7 @@ export function hydrateTextInstance(
1418
1404
) : boolean {
1419
1405
precacheFiberNode ( internalInstanceHandle , textInstance ) ;
1420
1406
1421
- // TODO: Temporary hack to check if we're in a concurrent root. We can delete
1422
- // when the legacy root API is removed.
1423
- const isConcurrentMode =
1424
- ( ( internalInstanceHandle : Fiber ) . mode & ConcurrentMode ) !== NoMode ;
1425
-
1426
- return diffHydratedText ( textInstance , text , isConcurrentMode ) ;
1407
+ return diffHydratedText ( textInstance , text ) ;
1427
1408
}
1428
1409
1429
1410
export function hydrateSuspenseInstance (
@@ -1521,15 +1502,9 @@ export function didNotMatchHydratedContainerTextInstance(
1521
1502
parentContainer : Container ,
1522
1503
textInstance : TextInstance ,
1523
1504
text : string ,
1524
- isConcurrentMode : boolean ,
1525
1505
shouldWarnDev : boolean ,
1526
1506
) {
1527
- checkForUnmatchedText (
1528
- textInstance . nodeValue ,
1529
- text ,
1530
- isConcurrentMode ,
1531
- shouldWarnDev ,
1532
- ) ;
1507
+ checkForUnmatchedText ( textInstance . nodeValue , text , shouldWarnDev ) ;
1533
1508
}
1534
1509
1535
1510
export function didNotMatchHydratedTextInstance (
@@ -1538,16 +1513,10 @@ export function didNotMatchHydratedTextInstance(
1538
1513
parentInstance : Instance ,
1539
1514
textInstance : TextInstance ,
1540
1515
text : string ,
1541
- isConcurrentMode : boolean ,
1542
1516
shouldWarnDev : boolean ,
1543
1517
) {
1544
1518
if ( parentProps [ SUPPRESS_HYDRATION_WARNING ] !== true ) {
1545
- checkForUnmatchedText (
1546
- textInstance . nodeValue ,
1547
- text ,
1548
- isConcurrentMode ,
1549
- shouldWarnDev ,
1550
- ) ;
1519
+ checkForUnmatchedText ( textInstance . nodeValue , text , shouldWarnDev ) ;
1551
1520
}
1552
1521
}
1553
1522
@@ -1590,17 +1559,14 @@ export function didNotHydrateInstance(
1590
1559
parentProps : Props ,
1591
1560
parentInstance : Instance ,
1592
1561
instance : HydratableInstance ,
1593
- isConcurrentMode : boolean ,
1594
1562
) {
1595
1563
if ( __DEV__ ) {
1596
- if ( isConcurrentMode || parentProps [ SUPPRESS_HYDRATION_WARNING ] !== true ) {
1597
- if ( instance . nodeType === ELEMENT_NODE ) {
1598
- warnForDeletedHydratableElement ( parentInstance , ( instance : any ) ) ;
1599
- } else if ( instance . nodeType === COMMENT_NODE ) {
1600
- // TODO: warnForDeletedHydratableSuspenseBoundary
1601
- } else {
1602
- warnForDeletedHydratableText ( parentInstance , ( instance : any ) ) ;
1603
- }
1564
+ if ( instance . nodeType === ELEMENT_NODE ) {
1565
+ warnForDeletedHydratableElement ( parentInstance , ( instance : any ) ) ;
1566
+ } else if ( instance . nodeType === COMMENT_NODE ) {
1567
+ // TODO: warnForDeletedHydratableSuspenseBoundary
1568
+ } else {
1569
+ warnForDeletedHydratableText ( parentInstance , ( instance : any ) ) ;
1604
1570
}
1605
1571
}
1606
1572
}
@@ -1671,12 +1637,9 @@ export function didNotFindHydratableInstance(
1671
1637
parentInstance : Instance ,
1672
1638
type : string ,
1673
1639
props : Props ,
1674
- isConcurrentMode : boolean ,
1675
1640
) {
1676
1641
if ( __DEV__ ) {
1677
- if ( isConcurrentMode || parentProps [ SUPPRESS_HYDRATION_WARNING ] !== true ) {
1678
- warnForInsertedHydratedElement ( parentInstance , type , props ) ;
1679
- }
1642
+ warnForInsertedHydratedElement ( parentInstance , type , props ) ;
1680
1643
}
1681
1644
}
1682
1645
@@ -1685,12 +1648,9 @@ export function didNotFindHydratableTextInstance(
1685
1648
parentProps : Props ,
1686
1649
parentInstance : Instance ,
1687
1650
text : string ,
1688
- isConcurrentMode : boolean ,
1689
1651
) {
1690
1652
if ( __DEV__ ) {
1691
- if ( isConcurrentMode || parentProps [ SUPPRESS_HYDRATION_WARNING ] !== true ) {
1692
- warnForInsertedHydratedText ( parentInstance , text ) ;
1693
- }
1653
+ warnForInsertedHydratedText ( parentInstance , text ) ;
1694
1654
}
1695
1655
}
1696
1656
0 commit comments