@@ -240,64 +240,6 @@ describe('StrictEffectsMode defaults', () => {
240
240
} ) ;
241
241
} ) ;
242
242
243
- it ( 'should double invoke effects in a mounted strict subtree' , async ( ) => {
244
- const log = [ ] ;
245
- function ComponentWithEffects ( { label} ) {
246
- React . useEffect ( ( ) => {
247
- log . push ( `useEffect mount "${ label } "` ) ;
248
- Scheduler . log ( `useEffect mount "${ label } "` ) ;
249
- return ( ) => {
250
- log . push ( `useEffect unmount "${ label } "` ) ;
251
- Scheduler . log ( `useEffect unmount "${ label } "` ) ;
252
- } ;
253
- } ) ;
254
-
255
- React . useLayoutEffect ( ( ) => {
256
- log . push ( `useLayoutEffect mount "${ label } "` ) ;
257
- Scheduler . log ( `useLayoutEffect mount "${ label } "` ) ;
258
- return ( ) => {
259
- log . push ( `useLayoutEffect unmount "${ label } "` ) ;
260
- Scheduler . log ( `useLayoutEffect unmount "${ label } "` ) ;
261
- } ;
262
- } ) ;
263
-
264
- return label ;
265
- }
266
-
267
- // this component intentionally introduces a component layer between the root and the StrictMode
268
- function RenderChildren ( { children} ) {
269
- return children ;
270
- }
271
-
272
- await act ( async ( ) => {
273
- ReactNoop . render (
274
- < RenderChildren >
275
- < ComponentWithEffects label = { 'one' } />
276
- < React . StrictMode >
277
- < ComponentWithEffects label = { 'two' } />
278
- </ React . StrictMode >
279
- </ RenderChildren > ,
280
- ) ;
281
-
282
- await waitForAll ( [
283
- 'useLayoutEffect mount "one"' ,
284
- 'useLayoutEffect mount "two"' ,
285
- 'useEffect mount "one"' ,
286
- 'useEffect mount "two"' ,
287
- ] ) ;
288
- expect ( log ) . toEqual ( [
289
- 'useLayoutEffect mount "one"' ,
290
- 'useLayoutEffect mount "two"' ,
291
- 'useEffect mount "one"' ,
292
- 'useEffect mount "two"' ,
293
- 'useLayoutEffect unmount "two"' ,
294
- 'useEffect unmount "two"' ,
295
- 'useLayoutEffect mount "two"' ,
296
- 'useEffect mount "two"' ,
297
- ] ) ;
298
- } ) ;
299
- } ) ;
300
-
301
243
it ( 'double invoking for effects for modern roots' , async ( ) => {
302
244
const log = [ ] ;
303
245
function App ( { text} ) {
0 commit comments