From aa5547c4f2c46bc9090ae195d428b10e095de035 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Wed, 26 Jun 2019 10:14:15 +0200 Subject: [PATCH] Remove componentWillReceiveProps from listings [MAILPOET-2133] --- assets/js/src/listing/listing.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/js/src/listing/listing.jsx b/assets/js/src/listing/listing.jsx index 746708b128..c8e64cfe45 100644 --- a/assets/js/src/listing/listing.jsx +++ b/assets/js/src/listing/listing.jsx @@ -104,9 +104,12 @@ const Listing = createReactClass({ // eslint-disable-line react/prefer-es6-class } }, - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - const params = nextProps.params || {}; - this.initWithParams(params); + componentDidUpdate: function componentDidUpdate(prevProps) { + const params = this.props.params || {}; + const prevParams = prevProps.params || {}; + if (!_.isEqual(params, prevParams)) { + this.initWithParams(params); + } }, componentWillUnmount: function componentWillUnmount() {