Not only can you easily see every place in the code that is using this construct, but, the framework provides a warning.
I definitely don't think it's bad to sanitize HTML content. but in general MOST text in a web app should be just text, and rendered with whatever HTML it contains. In very few places should the web application give user rich-text (aka HTML) access. In any place that the application does that, sanitization should be used.
dangerouslySetInnerHTML={{__html: variable}}
Not only can you easily see every place in the code that is using this construct, but, the framework provides a warning.
I definitely don't think it's bad to sanitize HTML content. but in general MOST text in a web app should be just text, and rendered with whatever HTML it contains. In very few places should the web application give user rich-text (aka HTML) access. In any place that the application does that, sanitization should be used.