mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #3310 from darcyadams/console-exists-before-warn
Check that console exists before warning
This commit is contained in:
Vendored
+3
-1
@@ -45,7 +45,9 @@ if (__DEV__) {
|
||||
if (!condition) {
|
||||
var argIndex = 0;
|
||||
var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
|
||||
console.warn(message);
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(message);
|
||||
}
|
||||
try {
|
||||
// --- Welcome to debugging React ---
|
||||
// This error was thrown as a convenience so that you can use this stack
|
||||
|
||||
Reference in New Issue
Block a user