mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 02:04:55 +00:00
Don't collect warnings if yellow box is disabled
Reviewed By: vjeux Differential Revision: D3641566 fbshipit-source-id: 1e2279be1656a305af8b4c5eaf32789a5ba6577d
This commit is contained in:
parent
cc05a710f9
commit
654a36018c
@ -25,9 +25,9 @@ import type EmitterSubscription from 'EmitterSubscription';
|
|||||||
import type {StackFrame} from 'parseErrorStack';
|
import type {StackFrame} from 'parseErrorStack';
|
||||||
|
|
||||||
type WarningInfo = {
|
type WarningInfo = {
|
||||||
count: number;
|
count: number,
|
||||||
stacktrace: Array<StackFrame>;
|
stacktrace: Array<StackFrame>,
|
||||||
symbolicated: boolean;
|
symbolicated: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
const _warningEmitter = new EventEmitter();
|
const _warningEmitter = new EventEmitter();
|
||||||
@ -85,6 +85,9 @@ function sprintf(format, ...args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateWarningMap(format, ...args): void {
|
function updateWarningMap(format, ...args): void {
|
||||||
|
if (console.disableYellowBox) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const stringifySafe = require('stringifySafe');
|
const stringifySafe = require('stringifySafe');
|
||||||
|
|
||||||
format = String(format);
|
format = String(format);
|
||||||
@ -268,9 +271,9 @@ const WarningInspector = ({
|
|||||||
|
|
||||||
class YellowBox extends React.Component {
|
class YellowBox extends React.Component {
|
||||||
state: {
|
state: {
|
||||||
stacktraceVisible: boolean;
|
stacktraceVisible: boolean,
|
||||||
inspecting: ?string;
|
inspecting: ?string,
|
||||||
warningMap: Map<any, any>;
|
warningMap: Map<any, any>,
|
||||||
};
|
};
|
||||||
_listener: ?EmitterSubscription;
|
_listener: ?EmitterSubscription;
|
||||||
dismissWarning: (warning: ?string) => void;
|
dismissWarning: (warning: ?string) => void;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user