In react native, I want to replace a keyword in a string with red. What should I do?

The original idea of

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>;
  };
Mar.22,2021
The content returned by the

replace method must be a string

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3cf90-2c33b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3cf90-2c33b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?