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-
31/**
42 * Temporarily disable act warnings.
53 *
64 * https://github.com/reactwg/react-18/discussions/102
75 */
86export 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 ;
1110
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+ } ;
1516}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments