Skip to content

Commit

Permalink
fix: safely import legacy act for Next (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasperz authored May 14, 2024
1 parent 4382e96 commit ecccc85
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 ?? (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'
Expand Down

0 comments on commit ecccc85

Please sign in to comment.