react-error-boundary
- Version 6.0.0
- Published
- 21.9 kB
- 1 dependency
- MIT license
Install
npm i react-error-boundaryyarn add react-error-boundarypnpm add react-error-boundaryOverview
Simple reusable React error boundary component
Index
Variables
Functions
Classes
Type Aliases
Variables
variable ErrorBoundaryContext
const ErrorBoundaryContext: any;Functions
function useErrorBoundary
useErrorBoundary: <TError = any>() => UseErrorBoundaryApi<TError>;function withErrorBoundary
withErrorBoundary: <T extends ComponentType<any>>( component: T, errorBoundaryProps: ErrorBoundaryProps) => ForwardRefExoticComponent<any>;Classes
class ErrorBoundary
class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {}constructor
constructor(props: any);method componentDidCatch
componentDidCatch: (error: Error, info: ErrorInfo) => void;method componentDidUpdate
componentDidUpdate: ( prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState) => void;method getDerivedStateFromError
static getDerivedStateFromError: (error: Error) => { didCatch: boolean; error: Error;};method render
render: () => any;method resetErrorBoundary
resetErrorBoundary: (...args: any[]) => void;Type Aliases
type ErrorBoundaryContextType
type ErrorBoundaryContextType = { didCatch: boolean; error: any; resetErrorBoundary: (...args: any[]) => void;};type ErrorBoundaryProps
type ErrorBoundaryProps = | ErrorBoundaryPropsWithFallback | ErrorBoundaryPropsWithComponent | ErrorBoundaryPropsWithRender;type ErrorBoundaryPropsWithComponent
type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & { fallback?: never; FallbackComponent: ComponentType<FallbackProps>; fallbackRender?: never;};type ErrorBoundaryPropsWithFallback
type ErrorBoundaryPropsWithFallback = ErrorBoundarySharedProps & { fallback: ReactNode; FallbackComponent?: never; fallbackRender?: never;};type ErrorBoundaryPropsWithRender
type ErrorBoundaryPropsWithRender = ErrorBoundarySharedProps & { fallback?: never; FallbackComponent?: never; fallbackRender: (props: FallbackProps) => ReactNode;};type FallbackProps
type FallbackProps = { error: any; resetErrorBoundary: (...args: any[]) => void;};type UseErrorBoundaryApi
type UseErrorBoundaryApi<TError> = { resetBoundary: () => void; showBoundary: (error: TError) => void;};Package Files (6)
Dependencies (1)
Dev Dependencies (20)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-error-boundary.
- Markdown[](https://www.jsdocs.io/package/react-error-boundary)
- HTML<a href="https://www.jsdocs.io/package/react-error-boundary"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2871 ms. - Missing or incorrect documentation? Open an issue for this package.
