I'm trying to implement a chat system which consist of Smilies :) . i'm using react js and i want to check and replace the smiley symbols in the receiving string.
return(<ListItem
leftAvatar={<Avatar src="profile pic" />}
primaryText="Name"
secondaryText={
<p>
{item.message}
</p>
}
secondaryTextLines={2}
/>
);
the string i want to check is given by {item.message}. ive tried to replace the string with {item.message}.replace(/:)/g,'<img src="../../../img/smileys/smile53893.gif"/>');
but it doesn't work!