I want a autosuggest workflow like below. Instead of displaying numeric ID, say 123 in a text field, I want to show custom information.
While I can do the rest with React, I still need to do autocomplete. I have two requirements:
{id: 123, title:"Prince Hall", info:"123 Foo St"}
JQueryUI and Twitter autocompletes have both features. But their item rendering takes is string based, but I want to reuse JSX templates which are virtual-dom based. I dont want to duplicate/hardcode JSX templates with string templates.
Check out react-select. It is simple, beautiful and currently has the most Github stars. Live demo here.
React-Autosuggest is a component that meets the requirements. It has custom rendering that works natively with React elements.
We can make it handle JS objects instead of plain strings.
onSuggestionSelected
props is a callback to get the selected suggestionsuggestionRenderer
method takes suggestion and returns React markuphttp://react-autosuggest.js.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With