when typescript uses antd,
websiteOptions assigns a return value that calls the map () method.
is used on component AutoComplete to report an error:
cannot assign type "void []" to type "DataSourceItemType [] | undefined".
this type should be void []
when map () is assigned to websiteOptions, type, but the type of values available for component dataSource should be DataSourceItemType [] | | undefined
what should be done here?
const websiteOptions = autoCompleteResult.map(website => {
<AutoCompleteOption key={website}>{website}</AutoCompleteOption>
})
<AutoComplete
dataSource={ websiteOptions } // "void[]" "DataSourceItemType[] | undefined"
onChange={this.handleWebsiteChange}
placeholder="">