Pass the itemIndex to the renderItem function#33
Pass the itemIndex to the renderItem function#33webdeb wants to merge 1 commit intomoroshko:masterfrom
Conversation
Add itemIndex to test
|
|
Awesome, I just ran into the same issue where I'd need the index of the current suggestion for an API-call. |
|
Maybe it's TOO MUCH :), but I am seriously thinking about an additional The benefits are, that you don't have to use |
|
@webdeb I like the thought, but I'd prefer to simply pass the whole |
|
@marvinhagemeister oh yeah, even better 👍 🚀 |
This passes the
itemIndexto therenderItemfunction, in cases where you need to know which index theitemhas, it might be helpful:For example:
(Yes, you can solve some of this by preparing the suggestions before you are passing them to the component (in case of React-Autosuggest), but this requires an additional loop before the rendering.