File tree Expand file tree Collapse file tree 2 files changed +8
-24
lines changed Expand file tree Collapse file tree 2 files changed +8
-24
lines changed Original file line number Diff line number Diff line change 1
- import { withCleanup } from "./withCleanup.js" ;
2
-
3
1
/**
4
2
* Temporarily disable act warnings.
5
3
*
6
4
* https://github.com/reactwg/react-18/discussions/102
7
5
*/
8
6
export function disableActWarnings ( ) {
9
- const prev = { prevActEnv : ( globalThis as any ) . IS_REACT_ACT_ENVIRONMENT } ;
10
- ( globalThis as any ) . IS_REACT_ACT_ENVIRONMENT = false ;
7
+ const anyThis = globalThis as any ;
8
+ const prevActEnv = anyThis . IS_REACT_ACT_ENVIRONMENT ;
9
+ anyThis . IS_REACT_ACT_ENVIRONMENT = false ;
11
10
12
- return withCleanup ( prev , ( { prevActEnv } ) => {
13
- ( globalThis as any ) . IS_REACT_ACT_ENVIRONMENT = prevActEnv ;
14
- } ) ;
11
+ return {
12
+ [ Symbol . dispose ] ( ) {
13
+ anyThis . IS_REACT_ACT_ENVIRONMENT = prevActEnv ;
14
+ } ,
15
+ } ;
15
16
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments