react-typeahead
react-typeahead copied to clipboard
Allow displayOption function to return an element
Relatively small changes to allow using custom element via displayOption prop inside the result list. The entire element will still be rendered inside <a href="#"> ... </a>
, but otherwise anything goes. Additionally, displayOption could no longer generate a string representation of the given option object without help. Summary of changes:
- Option allows elements as children
- Typeahead's _onOptionSelected converts optionString into a string toString if given value is not a string
Unit tests are included.
Looks like there is also a bit more invasive alternative #152.
@fmoo any plans to support this?