Skip to content

Commit

Permalink
fix(core): fix createForm memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Jun 13, 2021
1 parent ffce36c commit 5f11459
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion designable/antd/playground/template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/antd/dist/antd-with-locales.min.js"></script>
<script src="https://unpkg.com/@formily/reactive/dist/formily.reactive.umd.development.js"></script>
</body>
1 change: 0 additions & 1 deletion designable/antd/playground/webpack.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default {
alias: getWorkspaceAlias(),
},
externals: {
'@formily/reactive': 'Formily.Reactive',
react: 'React',
'react-dom': 'ReactDOM',
moment: 'moment',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/models/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ export class Form<ValueType extends object = any> {
}

onUnmount = () => {
this.disposers.forEach((dispose) => dispose())
this.query('*').forEach((field) => field.dispose())
this.unmounted = true
this.fields = {}
Expand Down

0 comments on commit 5f11459

Please sign in to comment.