From 1104e56f06c4080627d1327c5bbe3d1b6b24ad47 Mon Sep 17 00:00:00 2001 From: faceyspacey Date: Mon, 26 Feb 2018 16:22:22 -0800 Subject: [PATCH] fix($error): error component not shown with dynamic components after client side change 71 --- src/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index e1edaba..024f928 100644 --- a/src/index.js +++ b/src/index.js @@ -197,6 +197,7 @@ export default function universal( ) => { if (!this._mounted) return if (!state.error) state.error = null + this.handleAfter(state, isMount, isSync, isServer) } @@ -247,13 +248,13 @@ export default function universal( else if (userError) { return createElement(Err, { ...props, error: userError }) } + else if (error) { + return createElement(Err, { ...props, error }) + } else if (Component) { // primary usage (for async import loading + errors): return createElement(Component, props) } - else if (error) { - return createElement(Err, { ...props, error }) - } return createElement(Loading, props) }