Socket
Socket
Sign inDemoInstall

react-error-overlay

Package Overview
Dependencies
0
Maintainers
5
Versions
84
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-error-overlay

An overlay for displaying stack frames.


Version published
Maintainers
5
Weekly downloads
4,635,674
decreased by-8.01%

Weekly downloads

Package description

What is react-error-overlay?

The react-error-overlay package is used to display an overlay in your React application during development that shows runtime errors, including stack traces. It is commonly included in development environments like Create React App to improve the developer experience by providing clear and immediate feedback on errors that occur during development.

What are react-error-overlay's main functionalities?

Displaying runtime errors in an overlay

This feature allows developers to display a full-screen overlay in their React application when a runtime error occurs. The overlay includes the error message, stack trace, and the file where the error occurred.

import { reportRuntimeError } from 'react-error-overlay';

reportRuntimeError(new Error('This is a runtime error'));

Customizing the overlay

Developers can customize the behavior of the overlay, such as setting a custom handler to open the source file in an editor when an error location is clicked.

import { setEditorHandler } from 'react-error-overlay';

setEditorHandler(function editorHandler(errorLocation) {
  // Custom logic to open the source file in an editor
});

Dismissing the overlay

This feature allows developers to programmatically dismiss the error overlay, which can be useful for handling errors gracefully or when implementing custom error recovery logic.

import { dismissRuntimeErrors } from 'react-error-overlay';

dismissRuntimeErrors();

Other packages similar to react-error-overlay

Readme

Source

react-error-overlay

react-error-overlay is an overlay which displays when there is a runtime error.

Development

When developing within this package, make sure you run npm start (or yarn start) so that the files are compiled as you work. This is run in watch mode by default.

If you would like to build this for production, run npm run build:prod (or yarn build:prod).
If you would like to build this one-off for development, you can run NODE_ENV=development npm run build (or NODE_ENV=development yarn build).

Keywords

FAQs

Last updated on 14 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc