react-error-boundary
Advanced tools
Comparing version 4.0.5 to 4.0.6
@@ -48,3 +48,3 @@ import { Component, ComponentType, FunctionComponent, ReactElement, ReactNode, ErrorInfo, PropsWithChildren, PropsWithRef, RefAttributes, ForwardRefExoticComponent, PropsWithoutRef } from "react"; | ||
export class ErrorBoundary extends Component<PropsWithRef<PropsWithChildren<ErrorBoundaryProps>>, ErrorBoundaryState> { | ||
state: ErrorBoundaryState; | ||
constructor(props: ErrorBoundaryProps); | ||
static getDerivedStateFromError(error: Error): { | ||
@@ -54,3 +54,3 @@ didCatch: boolean; | ||
}; | ||
resetErrorBoundary: (...args: any[]) => void; | ||
resetErrorBoundary(...args: any[]): void; | ||
componentDidCatch(error: Error, info: ErrorInfo): void; | ||
@@ -57,0 +57,0 @@ componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void; |
@@ -40,2 +40,7 @@ "use client"; | ||
class $6d6d4999e62b3ee0$export$e926676385687eaf extends (0, $8zHUo$react.Component) { | ||
constructor(props){ | ||
super(props); | ||
this.resetErrorBoundary = this.resetErrorBoundary.bind(this); | ||
this.state = $6d6d4999e62b3ee0$var$initialState; | ||
} | ||
static getDerivedStateFromError(error) { | ||
@@ -47,2 +52,12 @@ return { | ||
} | ||
resetErrorBoundary(...args) { | ||
const { error: error } = this.state; | ||
if (error !== null) { | ||
this.props.onReset?.({ | ||
args: args, | ||
reason: "imperative-api" | ||
}); | ||
this.setState($6d6d4999e62b3ee0$var$initialState); | ||
} | ||
} | ||
componentDidCatch(error, info) { | ||
@@ -89,16 +104,2 @@ this.props.onError?.(error, info); | ||
} | ||
constructor(...args){ | ||
super(...args); | ||
this.state = $6d6d4999e62b3ee0$var$initialState; | ||
this.resetErrorBoundary = (...args)=>{ | ||
const { error: error } = this.state; | ||
if (error !== null) { | ||
this.props.onReset?.({ | ||
args: args, | ||
reason: "imperative-api" | ||
}); | ||
this.setState($6d6d4999e62b3ee0$var$initialState); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -105,0 +106,0 @@ function $6d6d4999e62b3ee0$var$hasArrayChanged(a = [], b = []) { |
@@ -24,2 +24,7 @@ "use client"; | ||
class $44d7e150ebc754d2$export$e926676385687eaf extends (0, $hgUW1$Component) { | ||
constructor(props){ | ||
super(props); | ||
this.resetErrorBoundary = this.resetErrorBoundary.bind(this); | ||
this.state = $44d7e150ebc754d2$var$initialState; | ||
} | ||
static getDerivedStateFromError(error) { | ||
@@ -31,2 +36,12 @@ return { | ||
} | ||
resetErrorBoundary(...args) { | ||
const { error: error } = this.state; | ||
if (error !== null) { | ||
this.props.onReset?.({ | ||
args: args, | ||
reason: "imperative-api" | ||
}); | ||
this.setState($44d7e150ebc754d2$var$initialState); | ||
} | ||
} | ||
componentDidCatch(error, info) { | ||
@@ -73,16 +88,2 @@ this.props.onError?.(error, info); | ||
} | ||
constructor(...args){ | ||
super(...args); | ||
this.state = $44d7e150ebc754d2$var$initialState; | ||
this.resetErrorBoundary = (...args)=>{ | ||
const { error: error } = this.state; | ||
if (error !== null) { | ||
this.props.onReset?.({ | ||
args: args, | ||
reason: "imperative-api" | ||
}); | ||
this.setState($44d7e150ebc754d2$var$initialState); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -89,0 +90,0 @@ function $44d7e150ebc754d2$var$hasArrayChanged(a = [], b = []) { |
{ | ||
"name": "react-error-boundary", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"description": "Simple reusable React error boundary component", | ||
@@ -5,0 +5,0 @@ "author": "Brian Vaughn <brian.david.vaughn@gmail.com>", |
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
46205
337