react-error-boundary
Advanced tools
Comparing version 4.0.10 to 4.0.11
@@ -1,2 +0,2 @@ | ||
import { Component, ErrorInfo, PropsWithChildren, PropsWithRef } from "react"; | ||
import { Component, ErrorInfo } from "react"; | ||
import { ErrorBoundaryProps } from "./types.js"; | ||
@@ -7,3 +7,3 @@ type ErrorBoundaryState = { | ||
}; | ||
export declare class ErrorBoundary extends Component<PropsWithRef<PropsWithChildren<ErrorBoundaryProps>>, ErrorBoundaryState> { | ||
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> { | ||
constructor(props: ErrorBoundaryProps); | ||
@@ -10,0 +10,0 @@ static getDerivedStateFromError(error: Error): { |
@@ -1,2 +0,2 @@ | ||
import { Component, ComponentType, FunctionComponent, ReactElement, ReactNode } from "react"; | ||
import { Component, ComponentType, ErrorInfo, FunctionComponent, PropsWithChildren, ReactElement, ReactNode } from "react"; | ||
declare function FallbackRender(props: FallbackProps): ReactNode; | ||
@@ -7,6 +7,4 @@ export type FallbackProps = { | ||
}; | ||
type ErrorBoundarySharedProps = { | ||
onError?: (error: Error, info: { | ||
componentStack: string; | ||
}) => void; | ||
type ErrorBoundarySharedProps = PropsWithChildren<{ | ||
onError?: (error: Error, info: ErrorInfo) => void; | ||
onReset?: (details: { | ||
@@ -21,3 +19,3 @@ reason: "imperative-api"; | ||
resetKeys?: any[]; | ||
}; | ||
}>; | ||
export type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & { | ||
@@ -24,0 +22,0 @@ fallback?: never; |
@@ -93,3 +93,3 @@ 'use client'; | ||
} else { | ||
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop"); | ||
throw error; | ||
} | ||
@@ -96,0 +96,0 @@ } |
@@ -89,3 +89,3 @@ 'use client'; | ||
} else { | ||
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop"); | ||
throw error; | ||
} | ||
@@ -92,0 +92,0 @@ } |
{ | ||
"name": "react-error-boundary", | ||
"version": "4.0.10", | ||
"version": "4.0.11", | ||
"description": "Simple reusable React error boundary component", | ||
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>", | ||
"license": "MIT", | ||
"packageManager": "pnpm@8.6.10", | ||
"repository": { | ||
@@ -19,2 +20,7 @@ "type": "git", | ||
}, | ||
"development": { | ||
"module": "./dist/react-error-boundary.development.esm.js", | ||
"import": "./dist/react-error-boundary.development.cjs.mjs", | ||
"default": "./dist/react-error-boundary.development.cjs.js" | ||
}, | ||
"module": "./dist/react-error-boundary.esm.js", | ||
@@ -26,2 +32,8 @@ "import": "./dist/react-error-boundary.cjs.mjs", | ||
}, | ||
"imports": { | ||
"#is-development": { | ||
"development": "./src/env-conditions/development.ts", | ||
"default": "./src/env-conditions/production.ts" | ||
} | ||
}, | ||
"types": "dist/react-error-boundary.cjs.d.ts", | ||
@@ -50,3 +62,3 @@ "files": [ | ||
"@babel/preset-typescript": "^7.21.5", | ||
"@preconstruct/cli": "^2.7.0", | ||
"@preconstruct/cli": "^2.8.1", | ||
"@types/jest": "^26.0.15", | ||
@@ -61,3 +73,3 @@ "@types/react": "^18", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.1.2" | ||
"typescript": "^5.1.6" | ||
}, | ||
@@ -64,0 +76,0 @@ "peerDependencies": { |
@@ -13,2 +13,5 @@ # react-error-boundary | ||
# pnpm | ||
pnpm add react-error-boundary | ||
# yarn | ||
@@ -15,0 +18,0 @@ yarn add react-error-boundary |
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
33191
19
674
214