React-autosuggest: Warning about `componentWillReceiveProps` in React's Strict Mode

Created on 16 Mar 2019  路  7Comments  路  Source: moroshko/react-autosuggest

React's Strict Mode warns about "Unsafe lifecycle methods were found within a strict-mode tree".

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead.

https://github.com/moroshko/react-autosuggest/blob/d626cef720df0ed5a4c7df4d539836b86bda6afa/src/Autosuggest.js#L124-L143

help wanted

Most helpful comment

Any update on this @moroshko ?

All 7 comments

Now with React 16.9 it's even a non-strict mode warning ...

Any update on this @moroshko ?

Still very relevant, looking forward to updates

Here's a PR that should take care of it: https://github.com/moroshko/react-autosuggest/pull/681

Fixed in #681

@aberezkin this should not have been closed. It resolves https://github.com/moroshko/react-autosuggest/issues/670, but not this one. A warning is still shown in React's strictmode:

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code.

Can someone work on this?

Was this page helpful?
0 / 5 - 0 ratings