DEV Community

Discussion on: Creating a Promotion Tracker with React and Reloadly

Collapse
 
umoren profile image
Samuel Umoren • Edited

Awesome article.
I think it's also great for React beginners.
Can you briefly explain what <p dangerouslySetInnerHTML={{ __html: item.description }}></p> does?
most especially the dangerouslySetInnerHTML

Thanks

Collapse
 
fullstackmafia profile image
fullStackMafia🀄

Hi Umoren,

I'm glad you liked my article. So the dangerouslySetInnerHTML element is used to replace inner HTML in the browser DOM. It comes in handy when you have response data from an API that also has HTML tags attached to it. I hope this answers your question. You can read more about it here:

reactjs.org/docs/dom-elements.html...