Skip to content

Commit

Permalink
fix(component): better ES Modules handling (gregberge#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
bertho-zero authored and gregberge committed Feb 11, 2019
1 parent e7de1b2 commit 6b9a8f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/resolvers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import hoistNonReactStatics from 'hoist-non-react-statics'

export function resolveComponent(loadedModule, { Loadable }) {
const Component = loadedModule.default || loadedModule
// eslint-disable-next-line no-underscore-dangle
const Component = loadedModule.__esModule ? loadedModule.default : (loadedModule.default || loadedModule)
hoistNonReactStatics(Loadable, Component, {
preload: true,
})
Expand Down

0 comments on commit 6b9a8f1

Please sign in to comment.