Skip to content

Commit

Permalink
fix: make load compatible with loadable (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfantone authored and crash7 committed Mar 16, 2019
1 parent 9bb1fbc commit 0f8baf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Async.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export function asyncComponent({ LoadableComponent, loader }: AsyncOptions) {
};

AsyncRouteComponent.load = async (): Promise<ComponentType<AsyncProps>> => {
return loader().then(component => {
const loaderFn = loader.requireAsync || loader;
return loaderFn().then(component => {
Component = component.default || component;
return Component;
});
Expand Down

0 comments on commit 0f8baf4

Please sign in to comment.