-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to render differently each sections? #358
Comments
I'd just add the section info to each suggestion, and use it in
Does this help? |
Alright so each suggestion should contain their Thanks! |
I'd vote for reopening this issue, for the following reason: even though it's not too complicated to add For instance, I have to do this: getSectionSuggestions={section => (hits) => hits.map(h => {
h.section = section;
return h;
})} Which is a bit cumbersome, when the signature of Would that be a change you'd consider? Thanks! |
If I may add, the same issue is found with |
I'm not sure I understand the issue with |
@moroshko Yeah, actually I misunderstood the purpose of the function... it might be nice to have a I'm open to sending a PR but I'm short of bandwidth at the moment 😕 |
can someone help me how can I render unique elements in render sugestions? |
+1 for a new @moroshko Would you accept a PR for this principally? |
@ulrichb Have been hacking around this for a while now. If @moroshko is open for that change I can try and help with a PR. |
PR that adds |
Let's say you have several sections for your autocomplete, but the rendering of each one is completely different. What would be the best way to provide different component depending on the section?
Right now the signature of
renderSuggestion
isfunction renderSuggestion(suggestion, { query })
, so it means that your rendering needs to be based on the content of the suggestion to decide how to render. Is there another way to handle this?The text was updated successfully, but these errors were encountered: