-
Notifications
You must be signed in to change notification settings - Fork 715
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
新增 addEventListener 方式兜底组件代码可能出现的遗漏清除回调或不及时导致组件卸载后回调仍然触发的问题 #1972
base: release
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4096356:
|
Passing run #2279 ↗︎
Details:
Review all test suite changes for PR #1972 ↗︎ |
packages/semi-ui/form/arrayField.tsx
Outdated
@@ -109,6 +109,7 @@ class ArrayFieldComponent extends Component<ArrayFieldProps, ArrayFieldState> { | |||
const updater = this.context; | |||
const { field } = this.props; | |||
updater.unRegisterArrayField(field); | |||
super.componentWillUnmount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非继承自 BaseComponent,实际上调的是 react 原生 component 的 willUnMount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以去掉。
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## release #1972 +/- ##
===========================================
- Coverage 87.29% 87.25% -0.04%
===========================================
Files 438 439 +1
Lines 25761 25807 +46
Branches 6556 6573 +17
===========================================
+ Hits 22489 22519 +30
- Misses 3272 3288 +16 ☔ View full report in Codecov by Sentry. |
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
新增 addEventListener 方式兜底组件代码可能出现的遗漏清除回调或不及时导致组件卸载后回调仍然触发的问题。
本次 PR 中,只在 Modal 中进行了调用,建议合并后过渡几个大版本没有问题反馈再更新其他组件的 addEventListener 到新的 addEventListener。
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information