Skip to content

Awesome ErrorBoundary. Show errors of React components where they occurred.

License

Notifications You must be signed in to change notification settings

dmitrymalakhov/react-bullet-holes

Repository files navigation

react-bullet-holes

Awesome ErrorBoundary. Show errors of React components where they occurred. Based on componentDidCatch from React 16.

react-bullet-holes

Install

yarn add -D react-bullet-holes

or

npm install --save-dev react-bullet-holes

Usage

import React from 'react';
import ErrorBoundary from 'react-bullet-holes';

/../

render() {
  return (
    <div>
      <ErrorBoundary>
        <Card />
      </ErrorBoundary>
    </div>
  );
}

Props

onError: func(error: { message: string, stack: string }, info: { componentStack: string })

This callback is called when throwing error in wrapped component.

Tips & Tricks

For more detailed trace you can add babel-plugin-transform-react-jsx-source

extended trace

After that in trace will be displayed exactly source file and line where error occurred.

About

Awesome ErrorBoundary. Show errors of React components where they occurred.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published