You can use the node-html-parser npm package:
import { parse } from 'node-html-parser';
function App() {
const root = parse('<ul id="list"><li>Hello World</li></ul>');
const text = root.querySelector('#list li').innerText;
return (
<div>
{text}
</div>
);
}
export default App;
References: