S
S
sergey19982022-01-24 15:26:53
Template Engines
sergey1998, 2022-01-24 15:26:53

How to put React component inside html markup from template engine?

There is a note in the output after the template engine, for example:

<div>
        <div>
             {{data}}
        </div>
       <span></span>
    </div>


The data variable is replaced with text, as a result, you can get pure html

And now the task is to put the span where the span is no longer a custom component

<div>
        <div>
             Name
        </div>
       <span><Component /></span>
    </div>


At the exit, this is how it would turn out and then it would be possible to work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2022-01-24
@Casufi

https://reactjs.org/docs/add-react-to-a-website.html
Only you have This is your span
<div id="like_button_container"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question