const [html, setHtml] = useState<string>("");
<div>
{html ? parse(html):""}
</div>
html is a template with its style but when it renders the other styles of the application override it. i want to prevent that common style of the application should not apply in html content and also html contents style should not apply to other components.
2
Answers
You can use Inline Styling or try You can read about CSS Specificity. Styling on react same as CSS original but if you want use Class just change to ClassName
I also bumped into a similar issue. Restyling each dom node in an HTML template might make things more complicated to maintain in the long run. Changing the global application might also require handling those changes in the HTML markup as well. To make things simple, I created a simple component that uses iframe and renders the markup in isolation making template secure and separated.