diff --git a/packages/react-scheduler/src/ReactScheduler.js b/packages/react-scheduler/src/ReactScheduler.js index bb389ea10f47..550d064a9b82 100644 --- a/packages/react-scheduler/src/ReactScheduler.js +++ b/packages/react-scheduler/src/ReactScheduler.js @@ -42,7 +42,6 @@ type CallbackConfigType = {| export type CallbackIdType = CallbackConfigType; import {canUseDOM} from 'shared/ExecutionEnvironment'; -import warningWithoutStack from 'shared/warningWithoutStack'; // We capture a local reference to any global, in case it gets polyfilled after // this module is initially evaluated. @@ -123,21 +122,23 @@ if (!canUseDOM) { localClearTimeout(timeoutId); }; } else { - if (typeof localRequestAnimationFrame !== 'function') { - warningWithoutStack( - false, - "This browser doesn't support requestAnimationFrame. " + - 'Make sure that you load a ' + - 'polyfill in older browsers. https://fb.me/react-polyfills', - ); - } - if (typeof localCancelAnimationFrame !== 'function') { - warningWithoutStack( - false, - "This browser doesn't support cancelAnimationFrame. " + - 'Make sure that you load a ' + - 'polyfill in older browsers. https://fb.me/react-polyfills', - ); + if (__DEV__) { + if (typeof console !== 'undefined') { + if (typeof localRequestAnimationFrame !== 'function') { + console.error( + "This browser doesn't support requestAnimationFrame. " + + 'Make sure that you load a ' + + 'polyfill in older browsers. https://fb.me/react-polyfills', + ); + } + if (typeof localCancelAnimationFrame !== 'function') { + console.error( + "This browser doesn't support cancelAnimationFrame. " + + 'Make sure that you load a ' + + 'polyfill in older browsers. https://fb.me/react-polyfills', + ); + } + } } let headOfPendingCallbacksLinkedList: CallbackConfigType | null = null;