Due to componentWillReceiveProps being [not recommended for use](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html), this code should be refactored to use componentDidUpdate.