Skip to content

Commit 397b5ae

Browse files
committed
Add a warning when running minified
1 parent 00ed100 commit 397b5ae

File tree

1 file changed

+12
-0
lines changed
  • packages/react-error-overlay/src

1 file changed

+12
-0
lines changed

packages/react-error-overlay/src/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,15 @@ window.__REACT_ERROR_OVERLAY_GLOBAL_HOOK__.iframeReady = function iframeReady()
167167
isLoadingIframe = false;
168168
updateIframeContent();
169169
};
170+
171+
var testFunc = function testFn() {};
172+
if ((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1) {
173+
console.warn(
174+
'It looks like you are using `react-error-overlay` in production. When ' +
175+
'deploying an application, `react-error-overlay` should be excluded ' +
176+
'as it is a heavy dependency meant for development.\n\n' +
177+
'Consider adding an error boundary to your tree to customize error ' +
178+
'handling behavior. See https://fb.me/react-error-boundaries for more ' +
179+
'information.'
180+
);
181+
}

0 commit comments

Comments
 (0)