diff --git a/packages/react-native-renderer/src/ReactFabric.js b/packages/react-native-renderer/src/ReactFabric.js index 632bf3b366f..a3a29f75658 100644 --- a/packages/react-native-renderer/src/ReactFabric.js +++ b/packages/react-native-renderer/src/ReactFabric.js @@ -152,7 +152,13 @@ const ReactFabric: ReactFabricType = { return getPublicRootInstance(root); }, + // Deprecated - this function is being renamed to stopSurface, use that instead. + // TODO (T47576999): Delete this once it's no longer called from native code. unmountComponentAtNode(containerTag: number) { + this.stopSurface(containerTag); + }, + + stopSurface(containerTag: number) { const root = roots.get(containerTag); if (root) { // TODO: Is it safe to reset this now or should I wait since this unmount could be deferred? diff --git a/scripts/rollup/shims/react-native/ReactFabric.js b/scripts/rollup/shims/react-native/ReactFabric.js index 8f6a708fd20..536ce9a6f30 100644 --- a/scripts/rollup/shims/react-native/ReactFabric.js +++ b/scripts/rollup/shims/react-native/ReactFabric.js @@ -23,6 +23,10 @@ if (__DEV__) { ReactFabric = require('../implementations/ReactFabric-prod'); } -BatchedBridge.registerCallableModule('ReactFabric', ReactFabric); +if (global.RN$Bridgeless) { + global.RN$stopSurface = ReactFabric.stopSurface; +} else { + BatchedBridge.registerCallableModule('ReactFabric', ReactFabric); +} module.exports = (ReactFabric: ReactNativeType);