Skip to content

Commit

Permalink
fix: safely import legacy act for Next
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasperz authored May 3, 2024
1 parent a4352be commit 9956023
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 9956023

Please sign in to comment.