i am trying to use a script when a certain component renders but script,src is not grabbing my resource file
const script = document.createElement('script');
script.src = '../script/index.js'; // not grabbing my index.js script
script.async = true;
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
}
}, []);