@samitouri / QOS-React-2 / commits / f3a506bc0c

Warn when using a minified copy of dev React

Fixes #4842.

Ben Alpert committed Oct 7, 2015 at 18:03 UTC f3a506bc0cc8de7d6d39e98205b5d2a27f7c0256
1 file changed +11 -1
src/renderers/dom/ReactDOM.js
+11 -1
@@ -74,6 +74,15 @@ if (__DEV__) {
74 }
75 }
76
77 + var testFunc = function testFn() {};
78 + warning(
79 + (testFunc.name || testFunc.toString()).indexOf('testFn') !== -1,
80 + 'It looks like you\'re using a minified copy of the development build ' +
81 + 'of React. When deploying React apps to production, make sure to use ' +
82 + 'the production build which skips development warnings and is faster. ' +
83 + 'See https://fb.me/react-minification for more details.'
84 + );
85 +
86 // If we're in IE8, check to see if we are in compatibility mode and provide
87 // information on preventing compatibility mode
88 var ieCompatibilityMode =
@@ -102,7 +111,8 @@ if (__DEV__) {
111
112 for (var i = 0; i < expectedFeatures.length; i++) {
113 if (!expectedFeatures[i]) {
105 - console.error(
114 + warning(
115 + false,
116 'One or more ES5 shims expected by React are not available: ' +
117 'https://fb.me/react-warning-polyfills'
118 );