A
A
azemlyankin2021-08-09 22:44:25
JavaScript
azemlyankin, 2021-08-09 22:44:25

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.
611185418b794305843588.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2021-08-18
@kleinmaximus

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 question

Ask a Question

731 491 924 answers to any question