I need to refactor the following code. I have tried to move the UNSAFE_componentWillReceiveProps into the componentDidUpdate Lifecycle as well as
UNSAFE_componentWillReceiveProps
componentDidUpdate