Merge pull request #3310 from darcyadams/console-exists-before-warn

Check that console exists before warning
This commit is contained in:
Ben Alpert
2015-03-10 15:32:32 -07:00
+3 -1
View File
@@ -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