@@ -88,6 +88,7 @@ import {
8888 NoFlags ,
8989 PerformedWork ,
9090 Placement ,
91+ PlacementDEV ,
9192 Hydrating ,
9293 Callback ,
9394 ContentReset ,
@@ -1080,7 +1081,8 @@ function updateDehydratedActivityComponent(
10801081 // Conceptually this is similar to Placement in that a new subtree is
10811082 // inserted into the React tree here. It just happens to not need DOM
10821083 // mutations because it already exists.
1083- primaryChildFragment . flags |= Hydrating ;
1084+ // We should still treat it as a newly inserted Fiber to double invoke Strict Effects.
1085+ primaryChildFragment . flags |= Hydrating | PlacementDEV ;
10841086 return primaryChildFragment ;
10851087 }
10861088 } else {
@@ -1896,7 +1898,8 @@ function updateHostRoot(
18961898 // Conceptually this is similar to Placement in that a new subtree is
18971899 // inserted into the React tree here. It just happens to not need DOM
18981900 // mutations because it already exists.
1899- node. flags = ( node . flags & ~ Placement ) | Hydrating ;
1901+ // We should still treat it as a newly inserted Fiber to double invoke Strict Effects.
1902+ node. flags = ( node . flags & ~ Placement ) | Hydrating | PlacementDEV ;
19001903 node = node . sibling ;
19011904 }
19021905 }
@@ -3101,7 +3104,8 @@ function updateDehydratedSuspenseComponent(
31013104 // Conceptually this is similar to Placement in that a new subtree is
31023105 // inserted into the React tree here. It just happens to not need DOM
31033106 // mutations because it already exists.
3104- primaryChildFragment . flags |= Hydrating ;
3107+ // We should still treat it as a newly inserted Fiber to double invoke Strict Effects.
3108+ primaryChildFragment . flags |= Hydrating | PlacementDEV ;
31053109 return primaryChildFragment ;
31063110 }
31073111 } else {
0 commit comments