From c4bae634ec562a1400ca3b49233360d2e1f89dac Mon Sep 17 00:00:00 2001 From: Jenni Nurmi Date: Tue, 27 Aug 2019 14:54:55 +0300 Subject: [PATCH] Don't use componentWillReceiveProps in Routes --- src/Routes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Routes.js b/src/Routes.js index f8e2ea05..98d09cff 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -78,12 +78,12 @@ class RouteComponentRenderer extends Component { handleLocationChanged(this.props.dispatch, this.props.location); } - componentWillReceiveProps(nextProps) { + componentDidUpdate() { // Calling loadData after initial rendering (on client side). // This makes it possible to use loadData as default client side data loading technique. // However it is better to fetch data before location change to avoid "Loading data" state. - callLoadData(nextProps); - handleLocationChanged(nextProps.dispatch, nextProps.location); + callLoadData(this.props); + handleLocationChanged(this.props.dispatch, this.props.location); } render() {