Answer the question
In order to leave comments, you need to log in
How can I not escape tags that come from Backend?
Good evening. Please tell me what is the problem.
I get an array of data from the backend, then using the map method I add HTML. Also, strings with tags arrive in my array, which, after being added to the application, are escaped.
Answer the question
In order to leave comments, you need to log in
Use dangerouslySetInnerHTML
https://ru.reactjs.org/docs/dom-elements.html#dang...
But truth be told, it's not entirely safe. If some data entered by other users is transferred to you from the server, then there is a chance of getting an XSS vulnerability.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question