From 995602386da7dead57aeec51804a224ff5276a77 Mon Sep 17 00:00:00 2001 From: Matias Perez <43894343+matiasperz@users.noreply.github.com> Date: Fri, 3 May 2024 16:19:21 -0300 Subject: [PATCH] fix: safely import legacy act for Next --- src/reconciler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reconciler.ts b/src/reconciler.ts index ce88278..63e0c16 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 +export const act: Act = (React as any)?.unstable_act ?? (React as any)?.act // Inject renderer meta into devtools const isProd = typeof process === 'undefined' || process.env?.['NODE_ENV'] === 'production'