Skip to content

Include option to pass in fallback UI component into ExceptionlessErrorBoundary #102

@polluterofminds

Description

@polluterofminds

In the current implementation, the ExceptionlessErrorBoundary works really well for capturing UI-level errors in the components. However, one of the benefits of Error Boundaries in React is the ability to render a fallback component when there is a component-level error. In order to do that alongside the ExceptionlessErrorBoundary, you have to write code that looks like this:

ReactDOM.render(
  <React.StrictMode>
    <ErrorBoundary>
      <ExceptionlessErrorBoundary>
        <App />
      </ExceptionlessErrorBoundary>
    </ErrorBoundary>
  </React.StrictMode>,
  document.getElementById('root')
);

Having to create your own Error Boundary class component just to render a fallback image feels tedious and repetitive. It would be nice if the ExceptionlessErrorBoundary took an optional component prop that could be used to render a fallback. Something like this:

ReactDOM.render(
  <React.StrictMode>
      <ExceptionlessErrorBoundary fallbackComponent={ErrorUI}>
        <App />
      </ExceptionlessErrorBoundary>
  </React.StrictMode>,
  document.getElementById('root')
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions