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.
|
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(); |
|
} |
|
} |
|
} |
React's Strict Mode warns about "Unsafe lifecycle methods were found within a strict-mode tree".
react-autosuggest/src/Autosuggest.js
Lines 124 to 143 in d626cef