Home > Software design >  How can I use HTML tags from API and display on page?
How can I use HTML tags from API and display on page?

Time:09-23

enter image description here <p>This is one of the most accurate answers that is able to resolve the birthday of 29th of Feb compared to any year of 28th Feb.</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>public int GetAge(DateTime birthDate)\n

I want to develop on my display page of answers and using this tags from API for building page.

CodePudding user response:

see this doc.

https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml

import React from 'react';
import { render } from 'react-dom';
const htmlString = '<h1>Hello World!            
  • Related