Answer the question
In order to leave comments, you need to log in
How to highlight words in ReactJs?
Hello! I have an array of titles and there is a search field, by the text from which words from the array should be searched and highlighted if they start with the entered text.
Those. if we entered javascript isn't awesome , then the string my javascript isn't awesome, sorry will become my javascript isn't awesome , sorry.
How can you do this in React? And in principle, in Javascript?
Forgot to add. The string can contain all sorts of different characters like (, ., ;, ) etc.
Answer the question
In order to leave comments, you need to log in
How do you like this idea impromptu)
in the value input field we set from the state, which we collect from
onChange when entering, we run through the array and if there is a match, then set this.props.hlt , if not then this.props.else, when this.props. else matches the value of array, then we reset it and set it in this.props.hlt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question