Open ulrichb opened 5 years ago
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?
Fixed in #681
It doesn't fix this warning for strict mode. To fix this issue the implementation has to change to this lifecycle: https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops.
Links from the snippet below:
index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
Please update the following components: Autosuggest, Autowhatever
still not fixed¿¿
"react": "^17.0.2",
React's Strict Mode warns about "Unsafe lifecycle methods were found within a strict-mode tree".
https://github.com/moroshko/react-autosuggest/blob/d626cef720df0ed5a4c7df4d539836b86bda6afa/src/Autosuggest.js#L124-L143