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

React strict mode fix by modifying usage of new lifecycle method

Open pcast01 opened this issue 7 years ago • 1 comments

Thanks so much for you library. I use it and I want to help out.

I wanted to add the lifecycle method getDerivedStateFromProps.

I am putting my own app thru React.StrictMode and came your library uses componentWillReceiveProps and this will just prepare your library to be up to date for used with React.Suspense and React.lazy(). Let me know if I can help out.

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props

pcast01 avatar Nov 23 '18 03:11 pcast01

Thanks so much! happy to accept a PR that does this

jstejada avatar Jan 02 '19 02:01 jstejada