API Reference@grafana/data › findHighlightChunksInText

findHighlightChunksInText() function

findHighlightChunksInText() function

Adapt findMatchesInText for react-highlight-words findChunks handler. See https://github.com/bvaughn/react-highlight-words#props

Signature

export declare function findHighlightChunksInText({ searchWords, textToHighlight, }: {
    searchWords: string[];
    textToHighlight: string;
}): any[];

Import

import { findHighlightChunksInText } from '@grafana/data';

Parameters

Parameter Type Description
{ searchWords, textToHighlight, } {
searchWords: string[];
textToHighlight: string;
}

Returns:

any[]