Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(loader): pass single-spa props to frameworkLifeCycles #1314

Closed
wants to merge 1 commit into from

Conversation

jk4235
Copy link

@jk4235 jk4235 commented Mar 10, 2021

Checklist
  • npm test passes
  • commit message follows commit guidelines
Description of change
  • 将single-spa生命周期的钩子的参数传递给框架的生命周期函数,以便特殊情况下手动加卸载子应用或者查看子应用状态

@kuitos
Copy link
Member

kuitos commented Mar 10, 2021

lifecycle function 里的第一个参数 app 里应该是有 props 的,app.props 可以直接取到

@@ -44,9 +44,10 @@ function execHooksChain<T extends ObjectType>(
hooks: Array<LifeCycleFn<T>>,
app: LoadableApp<T>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app 里是带 props 数据的,app.props

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app里的props不包含single-spa生命周期里传进来的props

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single-spa 里那些方法是供子应用调用的,主应用来用有点奇怪。
主应用要自己 mount/unmount 子应用的话,可以直接通过 microApp.unmount 的方式去做

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants