question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to skip caught error in error boundary

See original GitHub issue
<ErrorBoundary FallbackComponent={ErrorPage}>
</>
// inside error page

<Text>Error occured.</<Text>
<Text>Error reported to development team.</<Text>
<button>Ok, skip.</button>

//? How to skip?

ErrorBoundary itself does not return props.children to FallbackComponent. It should.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
johnkiely1commented, Nov 1, 2021

Hi @alimertcakar,

You should be able to call clearError to reset the error boundary, which will re-render the children. You would need to pass this as a property to the fallback component. This should avoid you needing to create your own custom error boundary.

1reaction
johnkiely1commented, Nov 1, 2021

I imagine this would be because of whatever caused the render error in the first place.

I think you would need to fix/avoid whatever caused that error and then call clearError to reset the error boundary. Alternatively you may need to consider redirecting to another page if they original page has errors such that it cannot be reloaded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI...
Read more >
React error handling with react-error-boundary - LogRocket Blog
So error boundaries only catch errors that occur in a lifecycle method, render method, and inside Hooks like useEffect . According to the...
Read more >
How to use React Router to ignore an ErrorBoundary for ...
I'm unsure how to 'override' this, or catch the error and redirect before the error boundary does its thing. Here's some relevant code...
Read more >
Handling Errors with Error Boundary | CSS-Tricks
Error boundaries are React components that catch JavaScript errors anywhere in their ... Here are errors that they will gracefully ignore:.
Read more >
React Error Handling And Reporting With Error Boundary And ...
This is entirely optional. You could catch the error without logging it. It is up to you. You can do whatever you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found