react-promise icon indicating copy to clipboard operation
react-promise copied to clipboard

Move to new lifecycle hooks

Open dantman opened this issue 7 years ago • 0 comments

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.

dantman avatar Apr 19 '18 04:04 dantman