Skip to content

Commit 499b250

Browse files
authored
[@types/react-highlight-words] fix for issues with Highlighter… (DefinitelyTyped#42473)
Fix for two issues: * DefinitelyTyped#42472 * DefinitelyTyped#40733
1 parent 6219365 commit 499b250

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

types/react-highlight-words/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface Chunk {
2121
end: number;
2222
}
2323

24-
interface HighlighterProps {
24+
export interface HighlighterProps {
2525
/** The class name to be applied to an active match. Use along with activeIndex */
2626
activeClassName?: string;
2727
/** Specify the match index that should be actively highlighted. Use along with activeClassName */
@@ -62,6 +62,8 @@ interface HighlighterProps {
6262
unhighlightClassName?: string;
6363
/** Inline styles applied to unhighlighted text */
6464
unhighlightStyle?: React.CSSProperties;
65+
/** Allows to pass through any parameter to wrapped component */
66+
[index: string]: any;
6567
}
6668

6769
declare class Highlighter extends React.Component<HighlighterProps> {}

types/react-highlight-words/react-highlight-words-tests.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class HighlighterTest extends React.Component {
1616
highlightTag="span"
1717
searchWords={["el", "or"]}
1818
textToHighlight="Hello World"
19+
customProp="My Custom Prop"
1920
/>
2021
<Highlighter
2122
activeClassName="activeClassName"

0 commit comments

Comments
 (0)