Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React-Native convert string to tag

$
0
0

I use the following search algorithm, which takes a string and search for special keys and returns a result. Anyway, fuzzysort.highlight(result,"","") returns a string with two marks.

For example:

when I search for 'el''or' in 'Hello World' it returns a string 'H*el*lo W*or*ld'fuzzysort.highlight(result, "*", "*")

Is there any function which can convert string to real tags?So that I can highlight my result in red text instead of * marks.

fuzzysort.highlight(result,"<Text style={styles.redText}>"," </Text>")

Maybe someone knows a way to do it correctly. Thanks


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>