@@ -129,7 +129,7 @@ describe('ReactHooksWithNoopRenderer', () => {
129
129
// Schedule some updates
130
130
ReactNoop . batchedUpdates ( ( ) => {
131
131
counter . current . updateCount ( 1 ) ;
132
- counter . current . updateCount ( ( count ) => count + 10 ) ;
132
+ counter . current . updateCount ( count => count + 10 ) ;
133
133
} ) ;
134
134
135
135
// Partially flush without committing
@@ -240,7 +240,7 @@ describe('ReactHooksWithNoopRenderer', () => {
240
240
expect ( Scheduler ) . toHaveYielded ( [ 'Count: 1' ] ) ;
241
241
expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 1' ) ] ) ;
242
242
243
- act ( ( ) => counter . current . updateCount ( ( count ) => count + 10 ) ) ;
243
+ act ( ( ) => counter . current . updateCount ( count => count + 10 ) ) ;
244
244
expect ( Scheduler ) . toHaveYielded ( [ 'Count: 11' ] ) ;
245
245
expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 11' ) ] ) ;
246
246
} ) ;
@@ -304,7 +304,7 @@ describe('ReactHooksWithNoopRenderer', () => {
304
304
305
305
const secondUpdater = updater ;
306
306
307
- act ( ( ) => firstUpdater ( ( count ) => count + 10 ) ) ;
307
+ act ( ( ) => firstUpdater ( count => count + 10 ) ) ;
308
308
expect ( Scheduler ) . toHaveYielded ( [ 'Count: 11' ] ) ;
309
309
expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 11' ) ] ) ;
310
310
@@ -441,7 +441,7 @@ describe('ReactHooksWithNoopRenderer', () => {
441
441
442
442
function Bar ( { triggerUpdate} ) {
443
443
if ( triggerUpdate ) {
444
- setStep ( ( x ) => x + 1 ) ;
444
+ setStep ( x => x + 1 ) ;
445
445
}
446
446
return < Text text = "Bar" /> ;
447
447
}
@@ -519,9 +519,9 @@ describe('ReactHooksWithNoopRenderer', () => {
519
519
function Counter ( { row : newRow } ) {
520
520
const [ count , setCount ] = useState ( 0 ) ;
521
521
if ( count < 12 ) {
522
- setCount ( ( c ) => c + 1 ) ;
523
- setCount ( ( c ) => c + 1 ) ;
524
- setCount ( ( c ) => c + 1 ) ;
522
+ setCount ( c => c + 1 ) ;
523
+ setCount ( c => c + 1 ) ;
524
+ setCount ( c => c + 1 ) ;
525
525
}
526
526
Scheduler . unstable_yieldValue ( 'Render: ' + count ) ;
527
527
return < Text text = { count } /> ;
@@ -662,7 +662,7 @@ describe('ReactHooksWithNoopRenderer', () => {
662
662
663
663
// Increment a counter every time the signal changes
664
664
if ( signal !== newSignal ) {
665
- setCounter ( ( c ) => c + 1 ) ;
665
+ setCounter ( c => c + 1 ) ;
666
666
setSignal ( newSignal ) ;
667
667
if ( counter === 0 ) {
668
668
// We're suspending during a render that includes render phase
@@ -715,7 +715,7 @@ describe('ReactHooksWithNoopRenderer', () => {
715
715
716
716
// Increment a counter every time the signal changes
717
717
if ( signal !== newSignal ) {
718
- setCounter ( ( c ) => c + 1 ) ;
718
+ setCounter ( c => c + 1 ) ;
719
719
setSignal ( newSignal ) ;
720
720
}
721
721
@@ -796,7 +796,7 @@ describe('ReactHooksWithNoopRenderer', () => {
796
796
797
797
if ( counter === 0 ) {
798
798
startTransition ( ( ) => {
799
- setCounter ( ( c ) => c + 1 ) ;
799
+ setCounter ( c => c + 1 ) ;
800
800
} ) ;
801
801
}
802
802
@@ -866,7 +866,7 @@ describe('ReactHooksWithNoopRenderer', () => {
866
866
}
867
867
868
868
function Counter ( props , ref ) {
869
- const [ count , dispatch ] = useReducer ( reducer , props , ( p ) => {
869
+ const [ count , dispatch ] = useReducer ( reducer , props , p => {
870
870
Scheduler . unstable_yieldValue ( 'Init' ) ;
871
871
return p . initialCount ;
872
872
} ) ;
@@ -1297,7 +1297,7 @@ describe('ReactHooksWithNoopRenderer', () => {
1297
1297
] ) ;
1298
1298
1299
1299
// Update children.
1300
- setChildStates . forEach ( ( setChildState ) => setChildState ( 1 ) ) ;
1300
+ setChildStates . forEach ( setChildState => setChildState ( 1 ) ) ;
1301
1301
expect ( Scheduler ) . toFlushAndYieldThrough ( [
1302
1302
'Child one render' ,
1303
1303
'Child two render' ,
@@ -1306,7 +1306,7 @@ describe('ReactHooksWithNoopRenderer', () => {
1306
1306
] ) ;
1307
1307
1308
1308
// Schedule another update for children, and partially process it.
1309
- setChildStates . forEach ( ( setChildState ) => setChildState ( 2 ) ) ;
1309
+ setChildStates . forEach ( setChildState => setChildState ( 2 ) ) ;
1310
1310
expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Child one render' ] ) ;
1311
1311
1312
1312
// Schedule unmount for the parent that unmounts children with pending update.
@@ -1320,7 +1320,7 @@ describe('ReactHooksWithNoopRenderer', () => {
1320
1320
] ) ;
1321
1321
1322
1322
// Schedule updates for children too (which should be ignored)
1323
- setChildStates . forEach ( ( setChildState ) => setChildState ( 2 ) ) ;
1323
+ setChildStates . forEach ( setChildState => setChildState ( 2 ) ) ;
1324
1324
expect ( Scheduler ) . toFlushAndYield ( [
1325
1325
'Child one passive destroy' ,
1326
1326
'Child two passive destroy' ,
@@ -2324,7 +2324,7 @@ describe('ReactHooksWithNoopRenderer', () => {
2324
2324
let LogOnlyErrorBoundary ;
2325
2325
2326
2326
beforeEach ( ( ) => {
2327
- BrokenUseEffectCleanup = function ( ) {
2327
+ BrokenUseEffectCleanup = function ( ) {
2328
2328
useEffect ( ( ) => {
2329
2329
Scheduler . unstable_yieldValue ( 'BrokenUseEffectCleanup useEffect' ) ;
2330
2330
return ( ) => {
@@ -2812,10 +2812,9 @@ describe('ReactHooksWithNoopRenderer', () => {
2812
2812
2813
2813
function Counter ( { incrementBy} ) {
2814
2814
const [ count , updateCount ] = useState ( 0 ) ;
2815
- const increment = useCallback (
2816
- ( ) => updateCount ( ( c ) => c + incrementBy ) ,
2817
- [ incrementBy ] ,
2818
- ) ;
2815
+ const increment = useCallback ( ( ) => updateCount ( c => c + incrementBy ) , [
2816
+ incrementBy ,
2817
+ ] ) ;
2819
2818
return (
2820
2819
< >
2821
2820
< IncrementButton increment = { increment } ref = { button } />
@@ -2974,7 +2973,7 @@ describe('ReactHooksWithNoopRenderer', () => {
2974
2973
let ping ;
2975
2974
function App ( ) {
2976
2975
ping = useDebouncedCallback (
2977
- ( value ) => {
2976
+ value => {
2978
2977
Scheduler . unstable_yieldValue ( 'ping: ' + value ) ;
2979
2978
} ,
2980
2979
100 ,
0 commit comments