-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
The following code is causing a crash/hang:
import strReplaceAsArr from 'string-replace-to-array'
const addHighlightMarkup = ({ str, textFilter }) =>
strReplaceAsArr(
str,
new RegExp(textFilter, 'ig'),
match => <span className="highlighted-text">{match}</span>
)
...when textFilter is an empty string. This behaviour is inconsistent with String.prototype.replace which will accept/ignore an empty string.
Metadata
Metadata
Assignees
Labels
No labels