File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import React, {
7
7
useCallback ,
8
8
useRef ,
9
9
} from "react" ;
10
+ import { flushSync } from "react-dom" ;
10
11
import Alert from "./components/Alert" ;
11
12
import CrashAlert from "./components/CrashAlert" ;
12
13
import Footer from "./components/Footer" ;
@@ -303,13 +304,18 @@ const App = () => {
303
304
return ( ) => mq . removeEventListener ( "change" , ConfigToggler ) ;
304
305
} , [ ] ) ;
305
306
307
+ // Please do not remove `flushSync`: https://github.com/eslint/eslint.org/pull/745
306
308
const debouncedOnUpdate = useMemo (
307
309
( ) =>
308
- debounce ( value => {
309
- setFix ( false ) ;
310
- setText ( value ) ;
311
- storeState ( { newText : value } ) ;
312
- } , 400 ) ,
310
+ debounce (
311
+ value =>
312
+ flushSync ( ( ) => {
313
+ setFix ( false ) ;
314
+ setText ( value ) ;
315
+ storeState ( { newText : value } ) ;
316
+ } ) ,
317
+ 400 ,
318
+ ) ,
313
319
[ storeState ] ,
314
320
) ;
315
321
You can’t perform that action at this time.
0 commit comments