Function Keywords

  • Component for keywords rendering.

    Parameters

    Returns Element | Element[]

    <Keywords
    hits={keywords.hits}
    keywordComponent={({ hit }) => <span
    data-nosto-element="keyword"
    >
    {hit?._highlight?.keyword
    ? <span dangerouslySetInnerHTML={{ __html: hit._highlight.keyword }}></span>
    : hit.keyword
    }
    </span>}
    elementComponent={({ hit, keywordComponent, filter }) =>
    <AutocompleteElement hit={hit} filter={filter} class="ns-clickable ns-py-2 ns-px-4 ns-font-4">
    {keywordComponent}
    </AutocompleteElement>
    }
    />