Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-error-boundary

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-error-boundary - npm Package Compare versions

Comparing version 4.0.12 to 4.0.13

2

dist/declarations/src/withErrorBoundary.d.ts
import { RefAttributes, ForwardRefExoticComponent, PropsWithoutRef, ComponentType } from "react";
import { ErrorBoundaryProps } from "./types.js";
export declare function withErrorBoundary<Props extends Object>(component: ComponentType<Props>, errorBoundaryProps: ErrorBoundaryProps): ForwardRefExoticComponent<PropsWithoutRef<Props> & RefAttributes<any>>;
export declare function withErrorBoundary<Props extends object>(component: ComponentType<Props>, errorBoundaryProps: ErrorBoundaryProps): ForwardRefExoticComponent<PropsWithoutRef<Props> & RefAttributes<any>>;
{
"name": "react-error-boundary",
"version": "4.0.12",
"version": "4.0.13",
"description": "Simple reusable React error boundary component",

@@ -47,4 +47,4 @@ "author": "Brian Vaughn <brian.david.vaughn@gmail.com>",

"prerelease": "preconstruct build",
"prettier": "prettier --write \"**/*.{css,html,js,json,jsx,ts,tsx}\"",
"prettier:ci": "prettier --check \"**/*.{css,html,js,json,jsx,ts,tsx}\"",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "jest",

@@ -62,8 +62,16 @@ "test:watch": "jest --watch",

"@preconstruct/cli": "^2.8.1",
"@types/assert": "^1.5.10",
"@types/jest": "^26.0.15",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"assert": "^2.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"jest": "^29.4.3",
"jest-environment-jsdom": "^29.4.3",
"prettier": "^2.8.6",
"prettier": "^3.0.1",
"react": "^18",

@@ -77,10 +85,2 @@ "react-dom": "^18",

},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"react/prop-types": "off",
"react/no-did-update-set-state": "off",
"babel/no-unused-expressions": "off"
}
},
"preconstruct": {

@@ -87,0 +87,0 @@ "exports": {

@@ -23,3 +23,3 @@ # react-error-boundary

### `ErrorBoundary` component
Wrap an `ErrorBoundary` around other React components to "catch" errors and render a fallback UI. The component supports several ways to render a fallback (shown below).
Wrap an `ErrorBoundary` component around other React components to "catch" errors and render a fallback UI. The component supports several ways to render a fallback (as shown below).

@@ -29,3 +29,3 @@ > **Note** `ErrorBoundary` is a _client_ component. You can only pass props to it that are serializeable or use it in files that have a `"use client";` directive.

#### `ErrorBoundary` with `fallback` prop
The simplest way to render a default "something went wrong" type error message.
The simplest way to render a default "something went wrong" type of error message.
```js

@@ -147,3 +147,3 @@ "use client";

#### Dismiss the nearest error boundary
A fallback component can use this hook to request the nearest error boundary retry the render that original failed.
A fallback component can use this hook to request the nearest error boundary retry the render that originally failed.

@@ -217,2 +217,2 @@ ```js

[This blog post](https://kentcdodds.com/blog/use-react-error-boundary-to-handle-errors-in-react) shows more examples of how this package can be used, although it was written for the [version 3 API](https://github.com/bvaughn/react-error-boundary/releases/tag/v3.1.4).
[This blog post](https://kentcdodds.com/blog/use-react-error-boundary-to-handle-errors-in-react) shows more examples of how this package can be used, although it was written for the [version 3 API](https://github.com/bvaughn/react-error-boundary/releases/tag/v3.1.4).
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc