0

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>
1

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.