-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Open
Description
In react-reconciler, the flushSync export was renamed to flushSyncFromReconciler in PR #28500 (merged April 8, 2024). This is an undocumented breaking change for custom renderers.
Commit: #28500
According to that PR, custom renderers should now use:
reconciler.updateContainerSync()- to update synchronouslyreconciler.flushSyncWork()- to flush pending sync work
However, this migration path is not documented anywhere for custom renderer authors. The change silently causes flushSync to be undefined with no warning.
0.29.x API:
const reconciler = ReactReconciler(hostConfig)
const { flushSync } = reconciler // works
// Usage
flushSync(() => {
reconciler.updateContainer(element, container, null, callback)
})0.31.0+ API:
const reconciler = ReactReconciler(hostConfig)
const { flushSync } = reconciler // undefined!
// New intended usage (undocumented):
reconciler.updateContainerSync(element, container, null, callback)
reconciler.flushSyncWork()Could we please:
- Document the new API for custom renderers in the react-reconciler README
- Or add a deprecation warning when accessing the old
flushSyncproperty
This affects custom renderers like @opentui/react that were following the previous patterns.
Metadata
Metadata
Assignees
Labels
No labels