mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
da9364fa3e
commit
a83ea6ab8c
@@ -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,
|
||||
|
||||
@@ -91,14 +91,15 @@ class AppContainer extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
render(): React.Node {
|
||||
let yellowBox = null;
|
||||
let logBox = null;
|
||||
if (__DEV__) {
|
||||
if (
|
||||
!global.__RCTProfileIsProfiling &&
|
||||
!this.props.internal_excludeLogBox
|
||||
) {
|
||||
const YellowBox = require('../YellowBox/YellowBox');
|
||||
yellowBox = <YellowBox />;
|
||||
const LogBoxNotificationContainer = require('../LogBox/LogBoxNotificationContainer')
|
||||
.default;
|
||||
logBox = <LogBoxNotificationContainer />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ class AppContainer extends React.Component<Props, State> {
|
||||
<View style={styles.appContainer} pointerEvents="box-none">
|
||||
{!this.state.hasError && innerView}
|
||||
{this.state.inspector}
|
||||
{yellowBox}
|
||||
{logBox}
|
||||
</View>
|
||||
</RootTagContext.Provider>
|
||||
);
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user