-
-
Notifications
You must be signed in to change notification settings - Fork 53.5k
Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
使用 Table 组件的分页配置,且使用了 onChange,不设置 pagination 的 total 或 total 设置为 0,会导致 onChange 被执行,如果使用 Table 组件的组件调用了 setState,重新 render 后会导致死循环
Using the pagination configuration of the Table component and using onChange without setting the total of pagination or total to 0 will cause onChange to be executed, and if the component using the Table component calls setState, re-rendering will result in a infinity loop.
What is expected?
未设置 total 或 total 为 0 不会执行 onChange
What is actually happening?
未 total 或 total 为 0 执行了 onChange
Environment | Info |
---|---|
antd | 4.18.1 |
React | 16.14.0 |
System | macOS 12.0.1 |
Browser | Chrome 96 |
问题产生是因为修复这个问题:#33411
在此处判断 current !> maxPage 就执行 onChange 导致的
mergedPagination.onChange?.(mergedPagination.current, mergedPagination?.pageSize!); |
Metadata
Metadata
Assignees
Labels
No labels