From 2524c90a73f6ee703ff86ec357a514e5f350140f Mon Sep 17 00:00:00 2001 From: Chris McVittie Date: Fri, 14 Sep 2018 21:57:12 +0100 Subject: [PATCH] Throw errors that occur during render I've been using react-loadable in a create-react-app application, and have found that errors thrown during the rendering of a resolved component are getting swallowed by react-loadable. Presently an error during render will not log anything meaningful in the console. I think it is preferable that they throw exception which react-error-overlay can catch and display. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 14b5bfa3..58bb72e3 100644 --- a/src/index.js +++ b/src/index.js @@ -209,7 +209,7 @@ function createLoadableComponent(loadFn, options) { update(); }) .catch(err => { - update(); + throw err; }); }