Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/react-highlight-words/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface HighlighterProps {
*/
findChunks?: ((options: FindChunks) => Chunk[]) | undefined;
/** CSS class name applied to highlighted text */
highlightClassName?: string | undefined;
highlightClassName?: string | Record<string, string> | undefined;
/** Inline styles applied to highlighted text */
highlightStyle?: React.CSSProperties | undefined;
/**
Expand Down
5 changes: 5 additions & 0 deletions types/react-highlight-words/react-highlight-words-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class HighlighterTest extends React.Component {
unhighlightStyle={{ color: "red" }}
unhighlightTag={CustomUnhighlight}
/>
<Highlighter
highlightClassName={{ el: "highlight-el", or: "highlight-or" }}
searchWords={["el", "or"]}
textToHighlight="Hello World"
/>
</div>
);
}
Expand Down