I was wondering of I can create a script element using react, something like:
var reactScriptElement = React.createElement('script', {src: "d.js"});
ReactDOM.render(reactScriptElement, document.getElementById('button'));
But, the script is not run by the browser. However, doing it the native way, does seems to run it:
var script = document.createElement('script');
script.src = "./d.js";
var div = document.getElementById('button');
div.appendChild(script);
So, is it a bug, by design, or something I am doing wrong?
Edit: This is not a duplicate. The issue here is the difference between the two, why they are not acting the same.