Description
- Algolia currently allows highlighting array fields like this:
{hit._highlightResult.tagNames.map((_, i) => (
<Fragment key={i}>
{i !== 0 ? ', ' : null}
{components.Highlight({
hit,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- array index is allowed, type is off
// @ts-expect-error
attribute: ['tagNames', i],
})}
</Fragment>
))}
Reproduction
- I am not sure how to create a preview for this, because it depends on the server-side index having an array field
Preview →
Steps
Expected behavior
- no type/lint suppression is required
Environment
- OS: [e.g. Windows / Linux / macOS / iOS / Android]: all
- Browser: [e.g. Chrome, Safari]: all
- Autocomplete version: [e.g. 1.0.0]: 1.17.2