diff --git a/packages/react-native/index.js b/packages/react-native/index.js index 08c71232d66a..79b601abb36d 100644 --- a/packages/react-native/index.js +++ b/packages/react-native/index.js @@ -368,6 +368,9 @@ module.exports = { get UIManager() { return require('./Libraries/ReactNative/UIManager').default; }, + /** + * @deprecated Since 0.86, `unstable_batchedUpdates` is a no-op that synchronously invokes the callback. React batches updates automatically, so call the callback directly instead. + */ unstable_batchedUpdates(fn: (bookkeeping: T) => void, bookkeeping: T) { fn(bookkeeping); }, diff --git a/packages/react-native/index.js.flow b/packages/react-native/index.js.flow index 1886486c571c..6214d033bc16 100644 --- a/packages/react-native/index.js.flow +++ b/packages/react-native/index.js.flow @@ -442,6 +442,9 @@ export * as Systrace from './Libraries/Performance/Systrace'; export {default as ToastAndroid} from './Libraries/Components/ToastAndroid/ToastAndroid'; export * as TurboModuleRegistry from './Libraries/TurboModule/TurboModuleRegistry'; export {default as UIManager} from './Libraries/ReactNative/UIManager'; +/** + * @deprecated Since 0.86, `unstable_batchedUpdates` is a no-op that synchronously invokes the callback. React batches updates automatically, so call the callback directly instead. + */ export function unstable_batchedUpdates( fn: (bookkeeping: T) => void, bookkeeping: T, diff --git a/packages/react-native/types_DEPRECATED/public/ReactNativeRenderer.d.ts b/packages/react-native/types_DEPRECATED/public/ReactNativeRenderer.d.ts index 830898537f09..3e2bb07242ae 100644 --- a/packages/react-native/types_DEPRECATED/public/ReactNativeRenderer.d.ts +++ b/packages/react-native/types_DEPRECATED/public/ReactNativeRenderer.d.ts @@ -133,7 +133,10 @@ export interface GestureResponderHandlers { } /** - * React Native also implements unstable_batchedUpdates + * @deprecated Since 0.86, `unstable_batchedUpdates` is a no-op that synchronously invokes the callback. React batches updates automatically, so call the callback directly instead. */ export function unstable_batchedUpdates(callback: (a: A) => R, a: A): R; +/** + * @deprecated Since 0.86, `unstable_batchedUpdates` is a no-op that synchronously invokes the callback. React batches updates automatically, so call the callback directly instead. + */ export function unstable_batchedUpdates(callback: () => R): R;