holen icon indicating copy to clipboard operation
holen copied to clipboard

Prepare for async rendering

Open ThePaulMcBride opened this issue 6 years ago • 1 comments

To prepare for async rendering coming in a not too distant version of React, the following lines of the use of the lifecycle method componetWillReceiveProps should be removed.

Here is where it is currently being used. https://github.com/tkh44/holen/blob/master/src/index.js#L25-L31

According to this great article by the React team the best option is to use the new lifecycle method getDerivedStateFromProps .

The React team have released a polyfill for this method which would maintain backwards compatibility.

Let me know if you'd like help implementing this.

ThePaulMcBride avatar Mar 29 '18 17:03 ThePaulMcBride

If you would like to do this I would be grateful. I have started to use https://github.com/jamesplease/react-request more than this library. I should probably put up a link on the readme.

tkh44 avatar Apr 02 '18 06:04 tkh44