Skip to content

fix: handle flushSync rename in react-reconciler 0.32.0#454

Merged
msmps merged 7 commits intoanomalyco:mainfrom
remorses:fix-flushsync-api
Jan 1, 2026
Merged

fix: handle flushSync rename in react-reconciler 0.32.0#454
msmps merged 7 commits intoanomalyco:mainfrom
remorses:fix-flushsync-api

Conversation

@remorses
Copy link
Contributor

flushSync was renamed to flushSyncFromReconciler in react-reconciler 0.32.0.

This fix uses nullish coalescing to check for the new name first, falling back to the old name for backwards compatibility.

Ref: facebook/react#35424

@remorses remorses marked this pull request as ready for review December 29, 2025 10:55
Copilot AI review requested due to automatic review settings December 29, 2025 10:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a breaking change in react-reconciler version 0.32.0 where the flushSync function was renamed to flushSyncFromReconciler. The implementation uses nullish coalescing to check for the new name first, falling back to the old name for backwards compatibility with earlier versions.

Key Changes:

  • Added backwards-compatible access to flushSync function that works with both old and new versions of react-reconciler
  • Separated the flushSync extraction from createPortal destructuring to handle the renamed function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@msmps msmps self-assigned this Dec 29, 2025
@remorses
Copy link
Contributor Author

I also added an example to showcase flushSync works correctly

@msmps msmps merged commit 9639559 into anomalyco:main Jan 1, 2026
4 checks passed
msmps added a commit that referenced this pull request Jan 8, 2026
`flushSync` was renamed to `flushSyncFromReconciler` in react-reconciler
0.32.0.

This fix uses nullish coalescing to check for the new name first,
falling back to the old name for backwards compatibility.

Ref: facebook/react#35424

---------

Co-authored-by: Matt Simpson <7691252+msmps@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants