Render the HTML raw in React app

In the case that you have to render a dynamic HTML from database or somewhere, when you add the HTML raw as a variable into your React app, it just render the string, consider the example bellow:

 


The result will be:



Solution: Use dangerouslySetInnerHTML method in React, use it very easy:

 


The result will be:



© 2019 4codev

Created with love by Sil.