@dramaorg/reprehenderit-nemo-laboriosam

2.5.43 • Public • Published

@dramaorg/reprehenderit-nemo-laboriosam

Build Status Codecov Npm Version Npm Downloads

A simple and reusable React-Native error boundary component 🐛

Install

yarn add @dramaorg/reprehenderit-nemo-laboriosam

Documentation

API

These are the props that you can pass to the ErrorBoundary component:

Property Type Required Default
Children React.Children true
FallbackComponent React.Component false FallbackComponent
onError Function false

Children

Any children that can throw an error.

The fallback component that will be rendered after catching an error. By default the library comes with a built-in component.

onError

A function that receives two arguments:

  • error: The error catched by the component.
  • stackTrace: The stacktrace of the error.
onError(error: Error, stackTrace: string): void

These are the props that the FallbackComponent receives:

Property Type Default
error Error
resetError Function

error

The error object.

resetError

A function to reset the error state. You'll want to call this function to recover from the error state.

resetError(): void

Demo

@dramaorg/reprehenderit-nemo-laboriosam

/@dramaorg/reprehenderit-nemo-laboriosam/

    Package Sidebar

    Install

    npm i @dramaorg/reprehenderit-nemo-laboriosam

    Weekly Downloads

    411

    Version

    2.5.43

    License

    MIT

    Unpacked Size

    76.2 kB

    Total Files

    164

    Last publish

    Collaborators

    • vanthuanbt26