Skip to content

Commit

Permalink
fix: compat with legacy micro module
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Apr 10, 2024
1 parent 8e1ce99 commit 0a78ac3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/icestark-module/src/MicroModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export default class MicroModule extends React.Component<any, State> {
}
if (!shallowCompare(preRest, curRest)) {
// 对于除 moduleInfo 外的 props 更新,重新渲染模块
this.moduleLifecycleMount && this.moduleLifecycleMount(this.moduleComponent, this.mountNode || mountId, curRest);
this.moduleLifecycleMount && this.moduleLifecycleMount(
this.moduleComponent,
this.mountNode || (mountId && document.getElementById(mountId)),
curRest,
);
}
}

Expand Down Expand Up @@ -115,7 +119,7 @@ export default class MicroModule extends React.Component<any, State> {
} else {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { sandbox, moduleInfo, wrapperClassName, wrapperStyle, loadingComponent, handleError, mountId, ...rest } = this.props;
lifecycleMount(component, this.mountNode || mountId, rest);
lifecycleMount(component, this.mountNode || (mountId && document.getElementById(mountId)), rest);
}
}
} catch (err) {
Expand Down

0 comments on commit 0a78ac3

Please sign in to comment.