@@ -246,9 +246,9 @@ describe('StoreStressConcurrent', () => {
246
246
// 1. Capture the expected render result.
247
247
const snapshots = [ ] ;
248
248
let container = document . createElement ( 'div' ) ;
249
- // $FlowFixMe
250
- let root = ReactDOM . createRoot ( container ) ;
251
249
for ( let i = 0 ; i < steps . length ; i ++ ) {
250
+ // $FlowFixMe
251
+ const root = ReactDOM . createRoot ( container ) ;
252
252
act ( ( ) => root . render ( < Root > { steps [ i ] } </ Root > ) ) ;
253
253
// We snapshot each step once so it doesn't regress.
254
254
snapshots . push ( print ( store ) ) ;
@@ -320,7 +320,7 @@ describe('StoreStressConcurrent', () => {
320
320
for ( let j = 0 ; j < steps . length ; j ++ ) {
321
321
container = document . createElement ( 'div' ) ;
322
322
// $FlowFixMe
323
- root = ReactDOM . createRoot ( container ) ;
323
+ const root = ReactDOM . createRoot ( container ) ;
324
324
act ( ( ) => root . render ( < Root > { steps [ i ] } </ Root > ) ) ;
325
325
expect ( print ( store ) ) . toMatch ( snapshots [ i ] ) ;
326
326
act ( ( ) => root . render ( < Root > { steps [ j ] } </ Root > ) ) ;
@@ -337,7 +337,7 @@ describe('StoreStressConcurrent', () => {
337
337
for ( let j = 0 ; j < steps . length ; j ++ ) {
338
338
container = document . createElement ( 'div' ) ;
339
339
// $FlowFixMe
340
- root = ReactDOM . createRoot ( container ) ;
340
+ const root = ReactDOM . createRoot ( container ) ;
341
341
act ( ( ) =>
342
342
root . render (
343
343
< Root >
@@ -408,9 +408,9 @@ describe('StoreStressConcurrent', () => {
408
408
// This is the only step where we use Jest snapshots.
409
409
const snapshots = [ ] ;
410
410
let container = document . createElement ( 'div' ) ;
411
- // $FlowFixMe
412
- let root = ReactDOM . createRoot ( container ) ;
413
411
for ( let i = 0 ; i < steps . length ; i ++ ) {
412
+ // $FlowFixMe
413
+ const root = ReactDOM . createRoot ( container ) ;
414
414
act ( ( ) =>
415
415
root . render (
416
416
< Root >
@@ -512,6 +512,8 @@ describe('StoreStressConcurrent', () => {
512
512
513
513
// 2. Verify check Suspense can render same steps as initial fallback content.
514
514
for ( let i = 0 ; i < steps . length ; i ++ ) {
515
+ // $FlowFixMe
516
+ const root = ReactDOM . createRoot ( container ) ;
515
517
act ( ( ) =>
516
518
root . render (
517
519
< Root >
@@ -536,7 +538,7 @@ describe('StoreStressConcurrent', () => {
536
538
// Always start with a fresh container and steps[i].
537
539
container = document . createElement ( 'div' ) ;
538
540
// $FlowFixMe
539
- root = ReactDOM . createRoot ( container ) ;
541
+ const root = ReactDOM . createRoot ( container ) ;
540
542
act ( ( ) =>
541
543
root . render (
542
544
< Root >
@@ -582,7 +584,7 @@ describe('StoreStressConcurrent', () => {
582
584
// Always start with a fresh container and steps[i].
583
585
container = document . createElement ( 'div' ) ;
584
586
// $FlowFixMe
585
- root = ReactDOM . createRoot ( container ) ;
587
+ const root = ReactDOM . createRoot ( container ) ;
586
588
act ( ( ) =>
587
589
root . render (
588
590
< Root >
@@ -640,7 +642,7 @@ describe('StoreStressConcurrent', () => {
640
642
// Always start with a fresh container and steps[i].
641
643
container = document . createElement ( 'div' ) ;
642
644
// $FlowFixMe
643
- root = ReactDOM . createRoot ( container ) ;
645
+ const root = ReactDOM . createRoot ( container ) ;
644
646
act ( ( ) =>
645
647
root . render (
646
648
< Root >
@@ -690,7 +692,7 @@ describe('StoreStressConcurrent', () => {
690
692
// Always start with a fresh container and steps[i].
691
693
container = document . createElement ( 'div' ) ;
692
694
// $FlowFixMe
693
- root = ReactDOM . createRoot ( container ) ;
695
+ const root = ReactDOM . createRoot ( container ) ;
694
696
act ( ( ) =>
695
697
root . render (
696
698
< Root >
@@ -744,7 +746,7 @@ describe('StoreStressConcurrent', () => {
744
746
// Always start with a fresh container and steps[i].
745
747
container = document . createElement ( 'div' ) ;
746
748
// $FlowFixMe
747
- root = ReactDOM . createRoot ( container ) ;
749
+ const root = ReactDOM . createRoot ( container ) ;
748
750
act ( ( ) =>
749
751
root . render (
750
752
< Root >
@@ -897,9 +899,9 @@ describe('StoreStressConcurrent', () => {
897
899
// This is the only step where we use Jest snapshots.
898
900
const snapshots = [ ] ;
899
901
let container = document . createElement ( 'div' ) ;
900
- // $FlowFixMe
901
- let root = ReactDOM . createRoot ( container ) ;
902
902
for ( let i = 0 ; i < steps . length ; i ++ ) {
903
+ // $FlowFixMe
904
+ const root = ReactDOM . createRoot ( container ) ;
903
905
act ( ( ) =>
904
906
root . render (
905
907
< Root >
@@ -922,6 +924,8 @@ describe('StoreStressConcurrent', () => {
922
924
// which is different from the snapshots above. So we take more snapshots.
923
925
const fallbackSnapshots = [ ] ;
924
926
for ( let i = 0 ; i < steps . length ; i ++ ) {
927
+ // $FlowFixMe
928
+ const root = ReactDOM . createRoot ( container ) ;
925
929
act ( ( ) =>
926
930
root . render (
927
931
< Root >
@@ -1055,7 +1059,7 @@ describe('StoreStressConcurrent', () => {
1055
1059
// Always start with a fresh container and steps[i].
1056
1060
container = document . createElement ( 'div' ) ;
1057
1061
// $FlowFixMe
1058
- root = ReactDOM . createRoot ( container ) ;
1062
+ const root = ReactDOM . createRoot ( container ) ;
1059
1063
act ( ( ) =>
1060
1064
root . render (
1061
1065
< Root >
@@ -1107,7 +1111,7 @@ describe('StoreStressConcurrent', () => {
1107
1111
// Always start with a fresh container and steps[i].
1108
1112
container = document . createElement ( 'div' ) ;
1109
1113
// $FlowFixMe
1110
- root = ReactDOM . createRoot ( container ) ;
1114
+ const root = ReactDOM . createRoot ( container ) ;
1111
1115
act ( ( ) =>
1112
1116
root . render (
1113
1117
< Root >
@@ -1174,7 +1178,7 @@ describe('StoreStressConcurrent', () => {
1174
1178
// Always start with a fresh container and steps[i].
1175
1179
container = document . createElement ( 'div' ) ;
1176
1180
// $FlowFixMe
1177
- root = ReactDOM . createRoot ( container ) ;
1181
+ const root = ReactDOM . createRoot ( container ) ;
1178
1182
act ( ( ) =>
1179
1183
root . render (
1180
1184
< Root >
@@ -1226,7 +1230,7 @@ describe('StoreStressConcurrent', () => {
1226
1230
// Always start with a fresh container and steps[i].
1227
1231
container = document . createElement ( 'div' ) ;
1228
1232
// $FlowFixMe
1229
- root = ReactDOM . createRoot ( container ) ;
1233
+ const root = ReactDOM . createRoot ( container ) ;
1230
1234
act ( ( ) =>
1231
1235
root . render (
1232
1236
< Root >
@@ -1278,7 +1282,7 @@ describe('StoreStressConcurrent', () => {
1278
1282
// Always start with a fresh container and steps[i].
1279
1283
container = document . createElement ( 'div' ) ;
1280
1284
// $FlowFixMe
1281
- root = ReactDOM . createRoot ( container ) ;
1285
+ const root = ReactDOM . createRoot ( container ) ;
1282
1286
act ( ( ) =>
1283
1287
root . render (
1284
1288
< Root >
0 commit comments