Skip to content

Commit e47d04b

Browse files
RSNarapull[bot]
authored andcommitted
Make LogBox render through SurfaceRegistry
Summary: LogBox was using AppRegistry to render on to the screen. Switch LogBox over to using SurfaceRegistry instead. Changelog: [Internal] Reviewed By: sshic Differential Revision: D37223641 fbshipit-source-id: 59001ad290c1e2c2f14828d38a96f48bd1ab39ca
1 parent 4c3d1cb commit e47d04b

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

Libraries/ReactNative/AppRegistry.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,22 @@ const AppRegistry = {
338338
},
339339
};
340340

341-
BatchedBridge.registerCallableModule('AppRegistry', AppRegistry);
342-
343-
if (__DEV__) {
344-
const LogBoxInspector = require('../LogBox/LogBoxInspectorContainer').default;
345-
AppRegistry.registerComponent('LogBox', () => LogBoxInspector);
346-
} else {
347-
AppRegistry.registerComponent(
348-
'LogBox',
349-
() =>
350-
function NoOp() {
351-
return null;
352-
},
353-
);
341+
if (!(global.RN$Bridgeless === true)) {
342+
BatchedBridge.registerCallableModule('AppRegistry', AppRegistry);
343+
344+
if (__DEV__) {
345+
const LogBoxInspector =
346+
require('../LogBox/LogBoxInspectorContainer').default;
347+
AppRegistry.registerComponent('LogBox', () => LogBoxInspector);
348+
} else {
349+
AppRegistry.registerComponent(
350+
'LogBox',
351+
() =>
352+
function NoOp() {
353+
return null;
354+
},
355+
);
356+
}
354357
}
355358

356359
module.exports = AppRegistry;

ReactCommon/react/renderer/uimanager/SurfaceRegistryBinding.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ void SurfaceRegistryBinding::startSurface(
2525
parameters["initialProps"] = initalProps;
2626
parameters["fabric"] = true;
2727

28-
if (moduleName != "LogBox" &&
29-
runtime.global().hasProperty(runtime, "RN$SurfaceRegistry")) {
28+
if (runtime.global().hasProperty(runtime, "RN$SurfaceRegistry")) {
3029
auto registry =
3130
runtime.global().getPropertyAsObject(runtime, "RN$SurfaceRegistry");
3231
auto method = registry.getPropertyAsFunction(runtime, "renderSurface");
@@ -59,8 +58,7 @@ void SurfaceRegistryBinding::setSurfaceProps(
5958
parameters["initialProps"] = initalProps;
6059
parameters["fabric"] = true;
6160

62-
if (moduleName != "LogBox" &&
63-
runtime.global().hasProperty(runtime, "RN$SurfaceRegistry")) {
61+
if (runtime.global().hasProperty(runtime, "RN$SurfaceRegistry")) {
6462
auto registry =
6563
runtime.global().getPropertyAsObject(runtime, "RN$SurfaceRegistry");
6664
auto method = registry.getPropertyAsFunction(runtime, "setSurfaceProps");

0 commit comments

Comments
 (0)