mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-05 09:00:12 +08:00
* [react] Use HTMLDialogElement for the dialog node * Actually add the `open` property * This update requires typescript 2.6 * Update dependents of react to also require typescript 2.6
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