-
Notifications
You must be signed in to change notification settings - Fork 584
Open
Labels
Description
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.
react-autosuggest/src/Autosuggest.js
Lines 124 to 143 in d626cef
| componentWillReceiveProps(nextProps) { | |
| if (shallowEqualArrays(nextProps.suggestions, this.props.suggestions)) { | |
| if ( | |
| nextProps.highlightFirstSuggestion && | |
| nextProps.suggestions.length > 0 && | |
| this.justPressedUpDown === false && | |
| this.justMouseEntered === false | |
| ) { | |
| this.highlightFirstSuggestion(); | |
| } | |
| } else { | |
| if (this.willRenderSuggestions(nextProps)) { | |
| if (this.state.isCollapsed && !this.justSelectedSuggestion) { | |
| this.revealSuggestions(); | |
| } | |
| } else { | |
| this.resetHighlightedSuggestion(); | |
| } | |
| } | |
| } |
TimoVink, pavlos256, emanuel-sanabria-developer, sjbuysse, pietia and 46 morevlsergey, FullstackJack and mturki