I'm trying to bold the text in the first occurence of string, matching the input query but the character is getting bold on every occurence in the string.
Input : "9"
Current Output:9989459
Expected output:9989459
var display = "9989459"
var input = "9"
var splitArr = display.split(new RegExp(`(${input})`, 'gi'));
var result = splitArr.map((parts,i) => parts === input ? <b key={i}>{parts}</b> : parts)
return <span> {result} </span>