DEV Community

Agik Setiawan
Agik Setiawan

Posted on

Render HTML tag in Next JS or React JS

If we use WYSIWYG Editor in our content usually it will be save as HTML in Database.

render HTML tag in React / Next JS very simply with 'dangerouslySetInnerHTML'


const content = `<b>Test Content</b>`;

<p dangerouslySetInnerHTML={{ __html: content }}></p>
Enter fullscreen mode Exit fullscreen mode

Discussion (0)