react-sentry-error-boundary

1.2.1 • Public • Published

react-sentry-error-boundary

A React error boundary component with integrated Sentry error reporting using Raven JS. This library uses a single instance of Raven to manually capture exceptions in the React lifecycle method componentDidCatch.

Installation

npm install --save-dev react-sentry-error-boundary

Requirements

Peer Dependencies

prop-types >=15.5.0
raven-js >=3.26.3
react >=16.0.0

Usage

import MyWidget from './MyWidget'
import SentryErrorBoundary from 'react-sentry-error-boundary'
import React from 'react'
 
const App = () =>
  <SentryErrorBoundary dsn="https://<key>@sentry.io/<project>">
    <MyWidget />
  </SentryErrorBoundary>
 
export default App

Props

config

Documentation

A Sentry configuration object.

dsn

Documentation

REQUIRED. A Sentry DSN URL.

errorCallback

A callback function to execute on error.

errorNode

A node to render on error.

logErrors

A bool indicating whether errors are logged to Sentry. Defaults to true.

userContext

Documentation

A Sentry user context object.

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i react-sentry-error-boundary

    Weekly Downloads

    8

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    10.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • sebastianmoderski