Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-error-boundary

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-error-boundary

A simple and reusable React-Native error boundary component

  • 1.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44K
increased by15.13%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-error-boundary

Build Status Codecov Npm Version Npm Downloads

A simple and reusable React-Native error boundary component 🐛

Install

yarn add react-native-error-boundary

Documentation

API

ErrorBoundary

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

PropertyTypeRequiredDefault
ChildrenReact.Childrentrue
FallbackComponentReact.ComponentfalseFallbackComponent
onErrorFunctionfalse
Children

Any children that can throw an error.

FallbackComponent

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

FallbackComponent

These are the props that the FallbackComponent receives:

PropertyTypeDefault
errorError
resetErrorFunction
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

react-native-error-boundary

Keywords

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc