diff --git a/src/reconciler.ts b/src/reconciler.ts index 63e0c16..99809ee 100644 --- a/src/reconciler.ts +++ b/src/reconciler.ts @@ -454,7 +454,7 @@ export const reconciler = Reconciler< /** * Safely flush async effects when testing, simulating a legacy root. */ -export const act: Act = (React as any)?.unstable_act ?? (React as any)?.act +export const act: Act = 'unstable_act' in React ? (React as any).unstable_act : (React as any).act // Inject renderer meta into devtools const isProd = typeof process === 'undefined' || process.env?.['NODE_ENV'] === 'production'