The componentWillRecieveProps lifecycle hook is being deprecated, it would be nice if this library was refactored to not use it so it can continue to be used in React 16.3 StrictMode and future versions of React without warnings.
https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html
I believe the correct implementation of this would be to have getDerivedStateFromProps to pass the promise and status: statusTypes.none to state when nextProps.promise !== prevState.promise.
Thenf in componentDidUpdate run handlePromise when the promise in state/prevState changes.
The
componentWillRecievePropslifecycle hook is being deprecated, it would be nice if this library was refactored to not use it so it can continue to be used in React 16.3 StrictMode and future versions of React without warnings.https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html
I believe the correct implementation of this would be to have
getDerivedStateFromPropsto pass the promise andstatus: statusTypes.noneto state whennextProps.promise !== prevState.promise.Thenf in
componentDidUpdaterun handlePromise when the promise instate/prevStatechanges.