Answer the question
In order to leave comments, you need to log in
How to insert outer div in React?
There are various services (designers of forms and surveys) that say that you need to insert their script and some kind of div into the site in order to form dynamic elements in it ( )
I have a BrowserRouter that leads to the /contact page. And it turns out that my SPA first renders the main one, and when you click on the link, it gets to the desired page, but this div does not work there. When the /contact page is updated, this div is formed, or if you write it on the main page, then everything works. The outer script doesn't see the div initially, and then it's too late.
As I understand it, I need to dig towards componentDidMount(), but I don't understand how. <div id="999" data-id="999"></div>
Answer the question
In order to leave comments, you need to log in
You need to either manually include it by creating a script node, or access the script in the component through window if it has an api.
React often makes adaptations. Maybe in your case too.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question