str = "<p> this is paragraph </p>"
The above str can consist of any elements of HTML. So to get he text I have used the below code
in my react application.
let descriptionDiv = document.createElement('div');
descriptionDiv.innerHTML = description;
description = descriptionDiv.textContent || descriptionDiv.innerText;
Do I need to use ReactDOM in this scenario ?
Like: React.createElement('div');
But I don't know whether when to use it ? Is it safe to accessing dom directly?