mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164)
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user