I am trying to extract part of a string value that includes the Trade Mark in react and apply className or inline style so i can change the style, but the result i am getting from this code is [object object]
const dataTm = <span style={{ border: '2px black solid' }}>™</span>
const changeFormat = (item) => {
const replaceTm = item?.name.replace('™', `${dataTm}`)
return ReactHtmlParser(replaceTm)
}
const menu = () =>{
return(
<Link>
{item?.name.includes('™') ? changeFormat(item) : item?.name}
<Link>
)}