I am looking to render a javascript file. I have included some library code (specifically leaflet.js), and I am using a local script to run after the page loads to render the id='map' div correctly. However, in my react component I am trying this and it is not working.
Specifically, it seems that even though "http://localhost:3000/src/MapRender.js" is at the correct location, it is not being found with a "Syntax error: unexpected token <" which I know means is a server 404. The file however is in the same folder as the component.
I am using a Helmet component to load the library script in the , however I would like this script to execute once the page loads so it can always find the correct div.
For context, I have created this app with create-react-app and have done basically nothing else besides create this Map component and add a Helmet component to the App component.
render() {
return(
<div id="map">
<script type="text/javascript" src='MapRender.js'></script>
</div>
);
}