Im not sure if this has been asked before or anybody has encountered the same issue on reactjs. So the scenario is like this, I have an index.html file that include
Try this solution to call global functions from React with TypeScript enabled:
Either in index.html or some_site.js
function pass_function(){
alert('42');
}
Then, from your react component:
window["pass_function"]();
And, of course, you can pass a parameter:
//react
window["passp"]("react ts");
//js
function passp(someval) {
alert(`passes parameter: ${someval}`);
}