From 6a14de411d767c019815822dc08080e3a3068e9f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 16 Apr 2016 17:07:39 +0800 Subject: [PATCH] Fix uncontrolled table issue close #1433 #1434 --- components/table/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 27354d60ae..72d7c96755 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -85,9 +85,9 @@ let AntTable = React.createClass({ componentWillReceiveProps(nextProps) { if (('pagination' in nextProps) && nextProps.pagination !== false) { - this.setState({ - pagination: objectAssign({}, defaultPagination, this.state.pagination, nextProps.pagination) - }); + this.setState(previousState => ({ + pagination: objectAssign({}, defaultPagination, previousState.pagination, nextProps.pagination), + })); } // dataSource 的变化会清空选中项 if ('dataSource' in nextProps &&