Skip to content

Commit

Permalink
Add warning when using react-error-overlay in production (#3264)
Browse files Browse the repository at this point in the history
* Add a warning when running minified

* Add more robust check

* Update index.js
  • Loading branch information
Timer committed Oct 11, 2017
1 parent 86b4b6a commit 9ce144e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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,10 @@ window.__REACT_ERROR_OVERLAY_GLOBAL_HOOK__.iframeReady = function iframeReady()
isLoadingIframe = false;
updateIframeContent();
};

if (process.env.NODE_ENV === 'production') {
console.warn(
'react-error-overlay is not meant for use in production. You should ' +
'ensure it is not included in your build to reduce bundle size.'
);
}

0 comments on commit 9ce144e

Please sign in to comment.