react-autocomplete icon indicating copy to clipboard operation
react-autocomplete copied to clipboard

getItemValue() vs renderItem()

Open mellis481 opened this issue 6 years ago • 2 comments

getItemValue() and renderItem() seem redundant. Both are used to return what is displayed for each item. Why are they both necessary?

mellis481 avatar Jan 18 '19 20:01 mellis481

From what I can tell, renderItem returns layout/view for the autocomplete list. getItemValue returns what gets passed to onSelect.

unformatt avatar Feb 25 '19 21:02 unformatt

getItemValue is also used to filter the autocomplete list. This is actually causing problems for me because I want to filter on label but return an id.

unformatt avatar Feb 25 '19 22:02 unformatt