File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ var List = function (_React$Component) {
8888 }
8989 } , {
9090 key : 'componentDidUpdate' ,
91- value : function componentDidUpdate ( ) {
91+ value : function componentDidUpdate ( prevProps ) {
9292 var _props3 = this . props ,
9393 onDisplay = _props3 . onDisplay ,
9494 onNumOfListChange = _props3 . onNumOfListChange ,
@@ -102,7 +102,7 @@ var List = function (_React$Component) {
102102 /* Only setState and invoke callbacks when the state is changed to avoid infinite loop */
103103
104104
105- if ( activeData . length !== this . state . numOfItems || startingArticle !== this . state . startingArticle || lastArticle !== this . state . lastArticle ) {
105+ if ( activeData . length !== this . state . numOfItems || startingArticle !== this . state . startingArticle || lastArticle !== this . state . lastArticle || prevProps . data . length !== data . length ) {
106106 this . updateStatus ( ) ;
107107 }
108108 }
Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ class List extends React.Component {
5353 return populatedContainer ;
5454 }
5555
56- componentDidUpdate ( ) {
56+ componentDidUpdate ( prevProps ) {
5757 const { onDisplay, onNumOfListChange, data } = this . props ;
5858 const { activeData, startingArticle, lastArticle } = calcActiveData ( this . props ) ;
5959
6060 /* Only setState and invoke callbacks when the state is changed to avoid infinite loop */
6161 if ( activeData . length !== this . state . numOfItems ||
6262 startingArticle !== this . state . startingArticle ||
63- lastArticle !== this . state . lastArticle ) {
63+ lastArticle !== this . state . lastArticle ||
64+ prevProps . data . length !== data . length ) {
6465 this . updateStatus ( ) ;
6566 }
6667 }
You can’t perform that action at this time.
0 commit comments