I would like to execute embeded Javascript inside a React Component. The code is loaded with the page from an Express NodeJs server. It is running fine on a single page inside a browser.
<script type="text/javascript"
src="http://localhost:3000/embed.js"
data-schnack-host="//localhost:3000"
data-schnack-slug="foofee"
data-schnack-target="#my-comments"
data-schnack-partial-reply="Answer to this comment"
data-schnack-partial-post-comment="Write your comment here."
></script>
Comments:
<div id="my-comments"></div>
But I need to integrate this into the render() method of a React Component. I've tried everything like include the "embed.js" inside the "dist" folder, the Javascript code is loaded but not executed. The console is showing no warnings or errors, the script is just ignored.
I'm sure it is not a cross domain/checkOrigin problem because it is running like a charm inside an external browser.
Did I miss something ?