diff --git a/packages/react-error-overlay/src/index.js b/packages/react-error-overlay/src/index.js index a800595cffb..1cccd49d8c3 100644 --- a/packages/react-error-overlay/src/index.js +++ b/packages/react-error-overlay/src/index.js @@ -167,3 +167,15 @@ window.__REACT_ERROR_OVERLAY_GLOBAL_HOOK__.iframeReady = function iframeReady() isLoadingIframe = false; updateIframeContent(); }; + +var testFunc = function testFn() {}; +if ((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1) { + console.warn( + 'It looks like you are using `react-error-overlay` in production. When ' + + 'deploying an application, `react-error-overlay` should be excluded ' + + 'as it is a heavy dependency meant for development.\n\n' + + 'Consider adding an error boundary to your tree to customize error ' + + 'handling behavior. See https://fb.me/react-error-boundaries for more ' + + 'information.' + ); +}