File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ class Item extends React.Component {
25
25
}
26
26
27
27
boldSearchText ( children ) {
28
- regex = this . props . boldRegex
28
+ let regex = this . props . boldRegex
29
29
if ( ! regex ) {
30
30
const term = this . props . searchTerm ;
31
31
if ( ! children || ! term ) return children ;
32
- const regex = new RegExp ( '(' + escapeRegExp ( term ) + ')' , 'gi' ) ;
32
+ regex = new RegExp ( '(' + escapeRegExp ( term ) + ')' , 'gi' ) ;
33
33
}
34
34
return React . Children . map ( children , c => {
35
35
return ( typeof c === 'string' ) ? < span dangerouslySetInnerHTML = { { __html : c . replace ( regex , '<mark>$1</mark>' ) } } > </ span > : c ;
@@ -88,7 +88,7 @@ Item.propTypes = {
88
88
handleItemFocus : React . PropTypes . func ,
89
89
onSelect : React . PropTypes . func ,
90
90
data : React . PropTypes . object ,
91
- boldRegex : react . PropTypes . instanceOf ( RegExp )
91
+ boldRegex : React . PropTypes . instanceOf ( RegExp )
92
92
} ;
93
93
94
94
Item . defaultProps = {
You can’t perform that action at this time.
0 commit comments