JSPM

@gdo-bzh/error-boundary

1.0.0-rc.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q41856F
  • License MIT

Package Exports

  • @gdo-bzh/error-boundary

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gdo-bzh/error-boundary) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

version

error-boundary

NPM JavaScript Style Guide

React component that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.

more info here

Install

yarn add @gdo-bzh/error-boundary react

Usage

import React from 'react'

const Example = () => (
  <ErrorBoundary Fallback={({error}) => <div>{error.message}</div>}}>
    <div>somme content ...</div>
  </ErrorBoundary>
)

Types

type Props = {
  Fallback: React.ComponentType<{ error: Error }>
  logError?: (error: Error, errorInfo: React.ErrorInfo) => void
}

License

MIT © gdo-bzh