Skip to content

fix(useAntdTable): skip pending submissions after unmount - #2998

Open
Aminark wants to merge 2 commits into
alibaba:masterfrom
Aminark:fix/antd-table-submit-after-unmount
Open

Aminark wants to merge 2 commits into
alibaba:masterfrom
Aminark:fix/antd-table-submit-after-unmount

Conversation

@Aminark

@Aminark Aminark commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤔 This is a ...

  • Bug fix

🔗 Related issue link

Reproduced on the current master branch; regression tests are included.

💡 Background and solution

A pending search.submit() can start a request after useAntdTable has unmounted. The same happens when asynchronous form validation resolves after unmount. With pollingInterval configured, that request can restart polling after the cleanup has already run.

Check the existing unmounted ref before starting deferred validation and again before consuming its result. This also covers the initial automatic submission.

Validation: all four new regression tests fail before the fix. The useAntdTable, usePagination and useRequest polling suites pass after the fix (20 tests), and tsc --noEmit passes.

📝 Changelog

Language Changelog
🇺🇸 English Fix useAntdTable starting pending searches and restarting polling after unmount.
🇨🇳 Chinese 修复 useAntdTable 卸载后仍执行待处理查询并重新启动轮询的问题。

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ahooks@2998
npm i https://pkg.pr.new/@ahooks.js/use-url-state@2998

commit: 7927d2b

This branch has not been deployed

No deployments
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.

1 participant