mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* react-autosuggest: add support for sections * Update deps * Remove test as suggested Re. https://github.com/DefinitelyTyped/DefinitelyTyped/pull/39212#discussion_r337053458 * Revert "Update deps" This reverts commit 0bb7fcf74e8d8511c061261e15a4f5c49d241abb. |
||
|---|---|---|
| .. | ||
| index.d.ts | ||
| react-autosuggest-tests.tsx | ||
| README.md | ||
| tsconfig.json | ||
| tslint.json | ||
react-autosuggest usage notes
The definition uses generics for stronger typing. Read the TypeScript deep dive on JSX Generic components for details on consuming these type definitions.
Example
import * as Autosuggest from 'react-autosuggest'
interface Language {
name: string
year: number
}
const LanguageAutosuggest = Autosuggest as { new (): Autosuggest<Language> }
<LanguageAutosuggest
suggestions={suggestions}
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested.bind(this)}
getSuggestionValue={this.getSuggestionValue}
renderSuggestion={this.renderSuggestion}
onSuggestionSelected={this.onSuggestionsSelected}
alwaysRenderSuggestions={true}
inputProps={inputProps}
theme={theme}
/>
Find multiple full examples in react-autosuggest-tests.tsx