I have a react-router app that mounts User on /users. It works fine.
I then click a /users?page=2 link that passes in new props. Here getData uses this.props.location.query. So calling getData from componentWillReceiveProps will fetch stuff from page 1 instead of page 2.
I would have used componentHasReceivedProps method if it existed. What can I actually do?
componentWillMount: function(){ this.setState({data:null}); this.getData(); }, componentWillReceiveProps: function(nextProps){ this.setState({data:null}); this.getData(); },