Answer the question
In order to leave comments, you need to log in
How to make substring replacements in a string using html markup in react?
I found one option in the dock, but they themselves write - it's better not to use it, can it be implemented somehow differently?
We do not know in advance how many matches, performance is also a priority.
dangerouslySetInnerHTML={{
__html: option.name.replace(searchRegExp, `<span class="${cn(s.inputDropdown__match)}">$1</span>`),
}}
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