You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone reading this in the future, unfortunately there is no easy fix with just a prop, but I worked around it by passing this function as customSuggestionsContainer prop:
function renderSuggestions(children: ReactNode) {
const ul = children as ReactElement;
const suggestions = ul.props.children as ReactElement[];
// groupBy is a helper function from lodash
const groupedSuggestions = groupBy(suggestions, suggestion => suggestion.props.suggestion.group);
return (
<div className="suggestionList">
{Object.entries(groupedSuggestions).map(([group, suggestions]) =>
cloneElement(ul, { ...ul.props, key: group }, [
<li key={group} className="suggestionGroup">
{group}
</li>,
...suggestions
])
)}
</div>
);
}
Is there any way we can render the suggestions based on the group
The text was updated successfully, but these errors were encountered: