Skip to content

Commit

Permalink
Add a warning when running minified
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Oct 11, 2017
1 parent 00ed100 commit 397b5ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/react-error-overlay/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
);
}

0 comments on commit 397b5ae

Please sign in to comment.