fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 232 forks source link

Custom render TypeaheadOption children #232

Open dmacthedestroyer opened 7 years ago

dmacthedestroyer commented 7 years ago

I see there's a customListComponent that will allow you to override the default implementation of how it renders and behaves, but this is a really heavyweight option if all I want to do is control how the individual options render.

In my particular case, I need to style an option differently if it's a certain value but I can't seem to do that unless I rewrite the whole customListComponent.

I'd like to have a customOptionComponent (or have the displayOption prop be able to be a function with a node return type) or something so I could conditionally render the options without having to duplicate your selector and option code or having to reimplement all that behavior.

Is this something that I'm already capable of and am not seeing it, or would this be added functionality? I'm happy to work to include this, if need be, and am open to implementation suggestions.