From a83ea6ab8c331e6df117a49a24a25e0a01d0bdb6 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 19 Feb 2020 17:57:55 -0800 Subject: [PATCH] Switch to LogBox completely Summary: This diff replaces YellowBox with LogBox so that it can be deprecated and removed. After this diff, it will no longer be possible to go back to YellowBox and all paths referencing it will be gone. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D19949695 fbshipit-source-id: 28a55866e514020bdcc6854aae565cffbbe8af58 --- Libraries/Core/ExceptionsManager.js | 3 +-- Libraries/ReactNative/AppContainer.js | 13 +++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index 0565ef469c..3b6a589484 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -76,8 +76,7 @@ function reportException( message = e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`; - const isHandledByLogBox = - e.forceRedbox !== true && global.__unstable_isLogBoxEnabled === true; + const isHandledByLogBox = e.forceRedbox !== true; const data = preprocessException({ message, diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index e67bd0742a..e7772fc14f 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -91,14 +91,15 @@ class AppContainer extends React.Component { } render(): React.Node { - let yellowBox = null; + let logBox = null; if (__DEV__) { if ( !global.__RCTProfileIsProfiling && !this.props.internal_excludeLogBox ) { - const YellowBox = require('../YellowBox/YellowBox'); - yellowBox = ; + const LogBoxNotificationContainer = require('../LogBox/LogBoxNotificationContainer') + .default; + logBox = ; } } @@ -132,7 +133,7 @@ class AppContainer extends React.Component { {!this.state.hasError && innerView} {this.state.inspector} - {yellowBox} + {logBox} ); @@ -147,8 +148,8 @@ const styles = StyleSheet.create({ if (__DEV__) { if (!global.__RCTProfileIsProfiling) { - const YellowBox = require('../YellowBox/YellowBox'); - YellowBox.install(); + const LogBox = require('../LogBox/LogBox'); + LogBox.install(); } }