I have all my external js and css files in public folder in the react app, and i am using them in the index.html file, Now when i render any component in , only the component gets loaded but the script associated with it not loaded, as the index.html file is not loaded. so how can i load my scripts for the component when it gets render for the first time I am using react-router-dom for navigation.
<script src="js/donutscript.js"></script>
<!--<script src="js/dashboard.js"></script>-->
<script src="js/custom.js"></script>
<script src="js/table.js"></script>
these are the scripts i am using in the index.html file