Skip to content

Commit d8570ec

Browse files
ejanzerBrian Vaughn
authored and
Brian Vaughn
committed
Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164)
1 parent 05e487a commit d8570ec

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,13 @@ const ReactFabric: ReactFabricType = {
199199
return getPublicRootInstance(root);
200200
},
201201

202+
// Deprecated - this function is being renamed to stopSurface, use that instead.
203+
// TODO (T47576999): Delete this once it's no longer called from native code.
202204
unmountComponentAtNode(containerTag: number) {
205+
this.stopSurface(containerTag);
206+
},
207+
208+
stopSurface(containerTag: number) {
203209
const root = roots.get(containerTag);
204210
if (root) {
205211
// TODO: Is it safe to reset this now or should I wait since this unmount could be deferred?

scripts/rollup/shims/react-native/ReactFabric.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ if (__DEV__) {
2323
ReactFabric = require('../implementations/ReactFabric-prod');
2424
}
2525

26-
BatchedBridge.registerCallableModule('ReactFabric', ReactFabric);
26+
if (global.RN$Bridgeless) {
27+
global.RN$stopSurface = ReactFabric.stopSurface;
28+
} else {
29+
BatchedBridge.registerCallableModule('ReactFabric', ReactFabric);
30+
}
2731

2832
module.exports = (ReactFabric: ReactNativeType);

0 commit comments

Comments
 (0)