react-highlight-words
react-highlight-words copied to clipboard
Passing additional information to findChunks
I am highlighting matching terms in lines of text. For my layout, each line needs to be rendered separately, so I have one <Highlighter>
per line. Furthermore, I need to highlight a term even if it spans more than a single line. To do this, I need to pass the previous and the next line as additional context for findChunks
to work with. How can this be achieved?
<Highlighter findChunks={(...args) => customFindChunk(...args, additionalContext)}/>