babel-plugin-transform-react-error-boundary

Wraps each component with your own error boundary component.

Usage no npm install needed!

<script type="module">
  import babelPluginTransformReactErrorBoundary from 'https://cdn.skypack.dev/babel-plugin-transform-react-error-boundary';
</script>

README

babel-plugin-transform-react-error-boundary

Wraps each component with your own error boundary component.

Quick start

Install:

npm install --save-dev babel-plugin-transform-react-error-boundary

Webpack config example:

{
    test: /\.jsx?$/,
    exclude: /node_modules/,
    use: {
        loader: 'babel-loader',
        options: {
            cacheDirectory: IS_DEBUG,
            plugins: [
                [ 'babel-plugin-transform-react-error-boundary', {
                    ErrorBoundary: 'common/components/ErrorBoundary/index.js'
                } ]
            ]
        }
    }
}