Skip to content

Commit 9ce144e

Browse files
authored
Add warning when using react-error-overlay in production (#3264)
* Add a warning when running minified * Add more robust check * Update index.js
1 parent 86b4b6a commit 9ce144e

File tree

1 file changed

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

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,10 @@ window.__REACT_ERROR_OVERLAY_GLOBAL_HOOK__.iframeReady = function iframeReady()
167167
isLoadingIframe = false;
168168
updateIframeContent();
169169
};
170+
171+
if (process.env.NODE_ENV === 'production') {
172+
console.warn(
173+
'react-error-overlay is not meant for use in production. You should ' +
174+
'ensure it is not included in your build to reduce bundle size.'
175+
);
176+
}

0 commit comments

Comments
 (0)