I'm adding a script dynamically in my react application and when I try to get its src I got undefined. All I want is to get an empty string src. here's my sample code
const script = document.createElement('script');
script.id = 'sitepalBlock';
script.type = 'text/javascript';
script.innerHTML = `SomeHeavyComputionFunctionCall()`;
document.getElementById('embed')?.appendChild(script);
if i try to add src mannualy like script.src="" then SomeHeavyComputionFunctionCall function not executing .