Permalink
Browse files

Remove custom error overlay in favor of CRA's built-in overlay

  • Loading branch information...
markerikson committed Jul 9, 2017
1 parent e179c95 commit 9782e30e434a5b86a8e9ce8f57fe9af0138db2f4
Showing with 3 additions and 61 deletions.
  1. +0 −1 package.json
  2. +1 −23 src/index.js
  3. +2 −37 yarn.lock
View
@@ -12,7 +12,6 @@
"react-dom": "^15.6.1",
"react-redux": "^5.0.5",
"react-toggle-display": "^2.2.0",
"redbox-react": "^1.4.3",
"redux": "^3.7.1",
"redux-devtools-extension": "^2.13.2",
"redux-orm": "^0.9.4",
View
@@ -24,29 +24,7 @@ let render = () => {
};
if(module.hot) {
// Support hot reloading of components
// and display an overlay for runtime errors
const renderApp = render;
const renderError = (error) => {
const RedBox = require("redbox-react").default;
ReactDOM.render(
<RedBox error={error} />,
rootEl,
);
};
// In development, we wrap the rendering function to catch errors,
// and if something breaks, log the error and render it to the screen
render = () => {
try {
renderApp();
}
catch(error) {
console.error(error);
renderError(error);
}
};
// Support hot reloading of components.
// Whenever the App component file or one of its dependencies
// is changed, re-import the updated component and re-render it
module.hot.accept("./app/layout/App", () => {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 9782e30

Please sign in to comment.