Answer the question
In order to leave comments, you need to log in
How to implement substring replacement in string with jsx support?
How to implement similar behavior with jsx support?
const array = ['Тверь', 'тверская', 'Тве', 'Колыма'];
const search = 'тве';
const r = () => {
const rg = new RegExp(search, 'gi');
return array.map(item => item.replace(rg, "<b>$&</b>"));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question