react-error-boundary
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -1,2 +0,2 @@ | ||
import { Component, ComponentType, FunctionComponent, ReactElement, ReactNode, ErrorInfo, PropsWithChildren, PropsWithRef } from "react"; | ||
import { Component, ComponentType, FunctionComponent, ReactElement, ReactNode, ErrorInfo, PropsWithChildren, PropsWithRef, RefAttributes, ForwardRefExoticComponent, PropsWithoutRef } from "react"; | ||
export type ErrorBoundaryContextType = { | ||
@@ -63,4 +63,4 @@ didCatch: boolean; | ||
export function useErrorBoundary<Error = any>(): UseErrorBoundaryApi<Error>; | ||
export function withErrorBoundary<Props extends Object>(Component: ComponentType<Props>, errorBoundaryProps: ErrorBoundaryProps): ComponentType<Props>; | ||
export function withErrorBoundary<Props extends Object>(component: ComponentType<Props>, errorBoundaryProps: ErrorBoundaryProps): ForwardRefExoticComponent<PropsWithoutRef<Props> & RefAttributes<any>>; | ||
//# sourceMappingURL=react-error-boundary.d.ts.map |
@@ -146,8 +146,9 @@ var $8zHUo$react = require("react"); | ||
function $9e88dd86e0bb2944$export$f0c7a449e0cfaec7(Component, errorBoundaryProps) { | ||
const Wrapped = (props)=>{ | ||
return (0, $8zHUo$react.createElement)((0, $6d6d4999e62b3ee0$export$e926676385687eaf), errorBoundaryProps, (0, $8zHUo$react.createElement)(Component, props)); | ||
}; | ||
function $9e88dd86e0bb2944$export$f0c7a449e0cfaec7(component, errorBoundaryProps) { | ||
const Wrapped = (0, $8zHUo$react.forwardRef)((props, ref)=>(0, $8zHUo$react.createElement)((0, $6d6d4999e62b3ee0$export$e926676385687eaf), errorBoundaryProps, (0, $8zHUo$react.createElement)(component, { | ||
...props, | ||
ref: ref | ||
}))); | ||
// Format for display in DevTools | ||
const name = Component.displayName || Component.name || "Unknown"; | ||
const name = component.displayName || component.name || "Unknown"; | ||
Wrapped.displayName = `withErrorBoundary(${name})`; | ||
@@ -161,2 +162,3 @@ return Wrapped; | ||
"use client"; | ||
$parcel$exportWildcard(module.exports, $6d6d4999e62b3ee0$exports); | ||
@@ -163,0 +165,0 @@ $parcel$exportWildcard(module.exports, $4a61716688322eb0$exports); |
@@ -1,2 +0,2 @@ | ||
import {isValidElement as $hgUW1$isValidElement, createElement as $hgUW1$createElement, Component as $hgUW1$Component, createContext as $hgUW1$createContext, useContext as $hgUW1$useContext, useState as $hgUW1$useState, useMemo as $hgUW1$useMemo} from "react"; | ||
import {isValidElement as $hgUW1$isValidElement, createElement as $hgUW1$createElement, Component as $hgUW1$Component, createContext as $hgUW1$createContext, useContext as $hgUW1$useContext, useState as $hgUW1$useState, useMemo as $hgUW1$useMemo, forwardRef as $hgUW1$forwardRef} from "react"; | ||
@@ -130,8 +130,9 @@ function $parcel$export(e, n, v, s) { | ||
function $62ff477d53f02a5b$export$f0c7a449e0cfaec7(Component, errorBoundaryProps) { | ||
const Wrapped = (props)=>{ | ||
return (0, $hgUW1$createElement)((0, $44d7e150ebc754d2$export$e926676385687eaf), errorBoundaryProps, (0, $hgUW1$createElement)(Component, props)); | ||
}; | ||
function $62ff477d53f02a5b$export$f0c7a449e0cfaec7(component, errorBoundaryProps) { | ||
const Wrapped = (0, $hgUW1$forwardRef)((props, ref)=>(0, $hgUW1$createElement)((0, $44d7e150ebc754d2$export$e926676385687eaf), errorBoundaryProps, (0, $hgUW1$createElement)(component, { | ||
...props, | ||
ref: ref | ||
}))); | ||
// Format for display in DevTools | ||
const name = Component.displayName || Component.name || "Unknown"; | ||
const name = component.displayName || component.name || "Unknown"; | ||
Wrapped.displayName = `withErrorBoundary(${name})`; | ||
@@ -145,2 +146,3 @@ return Wrapped; | ||
"use client"; | ||
@@ -147,0 +149,0 @@ |
{ | ||
"name": "react-error-boundary", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Simple reusable React error boundary component", | ||
@@ -5,0 +5,0 @@ "author": "Brian Vaughn <brian.david.vaughn@gmail.com>", |
@@ -22,5 +22,9 @@ # react-error-boundary | ||
> **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. | ||
```js | ||
"use client"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
@@ -35,2 +39,4 @@ | ||
```js | ||
"use client"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
@@ -61,2 +67,4 @@ | ||
```js | ||
"use client"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
@@ -88,2 +96,4 @@ | ||
```js | ||
"use client"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
@@ -112,2 +122,4 @@ | ||
```js | ||
"use client"; | ||
import { useErrorBoundary } from "react-error-boundary"; | ||
@@ -138,2 +150,4 @@ | ||
```js | ||
"use client"; | ||
import { useErrorBoundary } from "react-error-boundary"; | ||
@@ -158,2 +172,4 @@ | ||
```js | ||
"use client"; | ||
import {withErrorBoundary} from 'react-error-boundary' | ||
@@ -160,0 +176,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46138
329
183