was to use repace to replace keywords and then add < Text > to color both ends. But after discovering replace, < Text > is recognized as a string.
what should be done to achieve the effect described in the title?
_replaceSeachWordToRed=(index,text)=>{
let str = this.state.searchWord;
let reg = new RegExp(str, "g");
let redStr=()=>{return(<Text style={{color:"red"}}>str</Text>)};
let replacedStr=text.replace(reg, redStr);
return <Text style={[styles.contentFace]}>{index+1}. {replacedStr}</Text>;
};