From 73e50cd3d66f7b18aaefc00c5ade90dfe6373cda Mon Sep 17 00:00:00 2001 From: Matias Perez <43894343+matiasperz@users.noreply.github.com> Date: Wed, 1 May 2024 02:32:52 -0300 Subject: [PATCH 1/2] fix --- src/reconciler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reconciler.ts b/src/reconciler.ts index ce88278..06a5616 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 // Inject renderer meta into devtools const isProd = typeof process === 'undefined' || process.env?.['NODE_ENV'] === 'production' From 64075c4fa82127873a9356cff4039201ba93a500 Mon Sep 17 00:00:00 2001 From: Matias Perez <43894343+matiasperz@users.noreply.github.com> Date: Fri, 3 May 2024 16:15:43 -0300 Subject: [PATCH 2/2] apply Cody's suggestion --- src/reconciler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reconciler.ts b/src/reconciler.ts index 06a5616..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'