We can use dangerouslySetInnerHTML in the react render to load the html string properly in the dom. But how can we do if we can some javascript or jquery code in the html string. For example below. The html with javascript/jquery comes as api response.
var htmlString = "<div>Hello</div><script>alert('hello')</script>"