Reputation: 89
I am new to ReactJS. I am looping through JSON and need to include some links.
My JSON looks like this:
"text": ["Nähere Informationen zu den Funktionalitäten der Plattform und der Dienste finden Sie unter <a href=\"/features\">/features</a>."],
But when I loop through and expose the data, it just exposes plain text HTML.
<div className='small-53 medium-54 large-55 medium-offset-1 large-offset-1 columns end'>
<p className='text--uppercase text--book border--solid--bottom-red padding-bottom-10'>
{item.title}
</p>
</div>
Upvotes: 0
Views: 180
Reputation: 8784
Try:
<div className='small-53 medium-54 large-55 medium-offset-1 large-offset-1 columns end'>
<p className='text--uppercase text--book border--solid--bottom-red padding-bottom-10' dangerouslySetInnerHTML={ {__html: item.title} }/>
</div>
You can read more about dangerouslySetInnerHTML
here
Upvotes: 1