Skip to content

Commit

Permalink
Inline require to LogBox in AppRegistry
Browse files Browse the repository at this point in the history
Summary:
Prevent a require cycle from being shown when running RNTester

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D41183982

fbshipit-source-id: 5112902442d15fc8a4dce758782ffe7c2459e171
  • Loading branch information
javache authored and facebook-github-bot committed Nov 14, 2022
1 parent f657d29 commit 9125ff0
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Libraries/ReactNative/AppRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,15 @@ const AppRegistry = {
if (!(global.RN$Bridgeless === true)) {
BatchedBridge.registerCallableModule('AppRegistry', AppRegistry);

if (__DEV__) {
const LogBoxInspector =
require('../LogBox/LogBoxInspectorContainer').default;
AppRegistry.registerComponent('LogBox', () => LogBoxInspector);
} else {
AppRegistry.registerComponent(
'LogBox',
() =>
function NoOp() {
return null;
},
);
}
AppRegistry.registerComponent('LogBox', () => {
if (__DEV__) {
return require('../LogBox/LogBoxInspectorContainer').default;
} else {
return function NoOp() {
return null;
};
}
});
}

module.exports = AppRegistry;

0 comments on commit 9125ff0

Please sign in to comment.