I have a string that have a <a> text </a>
tag in it, but it was just read by the browser as a plain text when displayed inside a ReactJS's element,
Here is my sample code
const datas = [
{
title: 'the title1',
description: `the link was in <a href="#">here</a>, please click`
},
{
title: 'the title2',
description: `the link was in the last <a href="#">word</a>`
}
]
const renderDatas = () => {
return datas.map(data => {
return (
<div>
{data.description}
</div>
)
})
}
I already tried the accepted answer here and the only difference is, I'm using a string literal (`), but it just only read by the browser as plain text either.
My expected result was to make that <a href="#">here</a>
a clickable link when the browser reads it.