Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164)

This commit is contained in:
Emily
2020-01-10 10:21:32 -08:00
committed by Brian Vaughn
parent 05e487a12f
commit d8570ec6ea
2 changed files with 11 additions and 1 deletions
+6
View File
@@ -199,7 +199,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?
+5 -1
View File
@@ -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);