DEV Community

Discussion on: How to retry when React lazy fails

Collapse
 
goenning profile image
Guilherme Oenning

Maybe not, but that'll depend a lot from one app to another. This is just one solution to the problem.

We actually mix both. We retry 5 times with a 500ms interval, if it still fails, then the ErrorBoundary catches the error and show a generic error page. I think that 2.5 sec is not that long if we can avoid having the user seeing an unnecessary error page.