v6.0.0
Breaking change: onSuggestionsUpdateRequested
was replaced with onSuggestionsFetchRequested
and onSuggestionsClearRequested
.
- onSuggestionsUpdateRequested = ({ value, reason }) => {
+ onSuggestionsFetchRequested = ({ value }) => { // `reason` is not exposed anymore
this.setState({
suggestions: getSuggestions(value)
});
};
+ onSuggestionsClearRequested = () => {
+ this.setState({
+ suggestions: []
+ });
+ };
<Autosuggest
- onSuggestionsUpdateRequested={this.onSuggestionsUpdateRequested}
+ onSuggestionsFetchRequested={this.onSuggestionsUpdateRequested}
+ onSuggestionsClearRequested={this.onSuggestionsClearRequested}
...
/>
onSuggestionsFetchRequested
is very similar to onSuggestionsUpdateRequested
, except that it doesn't expose reason
anymore.
onSuggestionsClearRequested
must be specified (unless you set alwaysRenderSuggestions={true}
), and all it has to do is to set suggestions
to an empty array.