Is there a way to disable the error overlay when running a create-react-app in development mode?
This is the overlay I\'m talking about:
I\'m askin
The error overlay can be disabled by using the stopReportingRuntimeErrors helper utility in the react-error-overlay package.
First, install the react-error-overlay package:
yarn add react-error-overlay
Then in index.js — right before mounting the root React component, import the utility and invoke it like this:
import { stopReportingRuntimeErrors } from "react-error-overlay";
if (process.env.NODE_ENV === "development") {
stopReportingRuntimeErrors(); // disables error overlays
}
ReactDOM.render(
,
document.getElementById("root")
);
Error overlays in create-react-app should now be disabled.