Skip to content

Commit

Permalink
fix($error): error component not shown with dynamic components after …
Browse files Browse the repository at this point in the history
…client side change

71
  • Loading branch information
faceyspacey committed Feb 27, 2018
1 parent 66915eb commit 1104e56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default function universal<Props: Props>(
) => {
if (!this._mounted) return
if (!state.error) state.error = null

this.handleAfter(state, isMount, isSync, isServer)
}

Expand Down Expand Up @@ -247,13 +248,13 @@ export default function universal<Props: Props>(
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)
}
Expand Down

0 comments on commit 1104e56

Please sign in to comment.