From af710ab17793598ddba22fb42bb2356b5d3a6cfc Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 18 Feb 2020 06:16:54 -0800 Subject: [PATCH] Switch from YellowBox.ignoreWarnings to LogBox.ignoreLogs Summary: Migrates internal calls from ignoreWarnings to ignoreLogs so we can remove YellowBox. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D19813781 fbshipit-source-id: 16c7b3f2cd38cba1901eccb4d5b9a2396a37ba1b --- Libraries/YellowBox/YellowBox.js | 4 ++-- RNTester/js/RNTesterApp.ios.js | 6 ++---- ReactAndroid/src/androidTest/js/TestBundle.js | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Libraries/YellowBox/YellowBox.js b/Libraries/YellowBox/YellowBox.js index c77aba67d79..a43a849ed4a 100644 --- a/Libraries/YellowBox/YellowBox.js +++ b/Libraries/YellowBox/YellowBox.js @@ -38,9 +38,9 @@ let YellowBox; * * Ignore specific warnings by calling: * - * YellowBox.ignoreWarnings(['Warning: ...']); + * LogBox.ignoreLogs(['Warning: ...']); * - * Strings supplied to `YellowBox.ignoreWarnings` only need to be a substring of + * Strings supplied to `LogBox.ignoreLogs` only need to be a substring of * the ignored warning messages. */ if (__DEV__) { diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js index 8245a68d12b..1ae924c9b06 100644 --- a/RNTester/js/RNTesterApp.ios.js +++ b/RNTester/js/RNTesterApp.ios.js @@ -31,7 +31,7 @@ const { Text, useColorScheme, View, - YellowBox, + LogBox, } = require('react-native'); import type {RNTesterExample} from './types/RNTesterTypes'; @@ -42,9 +42,7 @@ import type {ColorSchemeName} from '../../Libraries/Utilities/NativeAppearance'; type Props = {exampleFromAppetizeParams?: ?string, ...}; -YellowBox.ignoreWarnings([ - 'Module RCTImagePickerManager requires main queue setup', -]); +LogBox.ignoreLogs(['Module RCTImagePickerManager requires main queue setup']); const APP_STATE_KEY = 'RNTesterAppState.v2'; diff --git a/ReactAndroid/src/androidTest/js/TestBundle.js b/ReactAndroid/src/androidTest/js/TestBundle.js index bafed35b098..4608c1780d3 100644 --- a/ReactAndroid/src/androidTest/js/TestBundle.js +++ b/ReactAndroid/src/androidTest/js/TestBundle.js @@ -10,7 +10,7 @@ 'use strict'; // Disable LogBox so we do not have to mock its dependencies. -require('react-native/Libraries/LogBox/LogBox').ignoreAllLogs(true); +require('react-native').LogBox.ignoreAllLogs(true); // Include callable JS modules first, in case one of the other ones below throws require('./ProgressBarTestModule');