From 9961605c5ab646902e6d1d434819e3a4d2443aed Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 12 Jun 2016 18:12:23 +0800 Subject: [PATCH] fix pagination change bug in Table --- components/table/index.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 42b4b144ff..b2d93eab40 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -101,9 +101,15 @@ export default class Table extends React.Component { componentWillReceiveProps(nextProps) { if (('pagination' in nextProps) && nextProps.pagination !== false) { - this.setState(previousState => ({ - pagination: { ...defaultPagination, ...previousState.pagination, ...nextProps.pagination }, - })); + this.setState(previousState => { + const newPagination = { + ...defaultPagination, + ...previousState.pagination, + ...nextProps.pagination, + }; + newPagination.current = newPagination.current || 1; + return { pagination: newPagination }; + }); } // dataSource 的变化会清空选中项 if ('dataSource' in nextProps &&