From 6e4fae0e2919cc19729dfd59078bef59a8d9901e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 19 Feb 2017 13:55:36 +0800 Subject: [PATCH] remove onChange functions in Table.onChange(pagination) --- components/table/Table.tsx | 7 +++++-- components/table/__tests__/Table.pagination.test.js | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 92ec6ef533..87192a8071 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -731,9 +731,12 @@ export default class Table extends React.Component, any> { /> : null; } + // Get pagination, filters, sorter prepareParamsArguments(state: any): [any, string[], Object] { - // 准备筛选、排序、分页的参数 - const pagination = state.pagination; + const pagination = { ...state.pagination }; + // remove useless handle function in Table.onChange + delete pagination.onChange; + delete pagination.onShowSizeChange; const filters = state.filters; const sorter: any = {}; if (state.sortColumn && state.sortOrder) { diff --git a/components/table/__tests__/Table.pagination.test.js b/components/table/__tests__/Table.pagination.test.js index 01be4faf38..06603404fa 100644 --- a/components/table/__tests__/Table.pagination.test.js +++ b/components/table/__tests__/Table.pagination.test.js @@ -68,8 +68,6 @@ describe('Table.pagination', () => { expect(handleChange).toBeCalledWith( { current: 2, - onChange: handlePaginationChange, - onShowSizeChange: noop, pageSize: 2, }, {},