Skip to content

Commit

Permalink
fix(component): better ES Modules handling (#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 0d3e7de commit 3628363
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/component/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 3628363

Please sign in to comment.