Skip to content

Commit

Permalink
fix: return moudle info
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed May 11, 2020
1 parent 2e41094 commit 75681ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/icestark-module/src/modules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const loadModule = async(targetModule: StarkModule, sandbox?: ISandbox) =

const { moduleInfo, moduleCSS } = importModules[name];

if (moduleInfo) {
if (!moduleInfo) {
const errMsg = 'load or exec module faild';
console.error(errMsg);
return Promise.reject(new Error(errMsg));
Expand Down Expand Up @@ -248,15 +248,16 @@ export class MicroModule extends React.Component<any, { loading: boolean }> {
this.setState({ loading: true });
try {
const { mount, component } = await loadModule(this.moduleInfo, sandbox);
this.setState({ loading: false });
if (mount && component) {
this.setState({ loading: false });
if (this.unmout) {
unmoutModule(this.moduleInfo, this.mountNode);
} else {
mount(component, this.mountNode, rest);
}
}
} catch (err) {
this.setState({ loading: false });
handleError(err);
}
}
Expand Down

0 comments on commit 75681ea

Please sign in to comment.