A
A
AlexMikhailov2020-07-17 15:27:42
JavaScript
AlexMikhailov, 2020-07-17 15:27:42

How to insert HTML type text field in REACT?

I received a text type field from the base, it contains tags
("<br>" in this form), you need to display this text, with this transfer in your component ...
There is a solution, but it is not explicit, you need a simpler one.

dangerouslySetInnerHTML={{__html: переменная.val.split("&lt;br&gt;").join("<br />")}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question