This doc: https://tomchentw.github.io/react-google-maps/basics/directions isn't working at all.
can't get around: error 'google' is not defined no-undef
I did find a solution that is partly working, e.g. using
return (
<GoogleMapLoader
containerElement={mapContainer}
googleMapElement={
<GoogleMap
defaultZoom={12}
defaultCenter={this.props.center}
options={{ streetviewcontrol: false, mapTypeControl: true}}>
</GoogleMap>
}
But I have no idea how to match this to the tutorial with componentDidMount etc. to get it to work with the direction service. Any help is greatly appreciated.
I am one step further, see this question: https://github.com/tomchentw/react-google-maps/issues/435
@jwamsterdam - Take a look at #414
Please refer to Getting Help section in the README (or #469).
add this line to top of your file: /*global google*/-> for disable ESLint
const google=window.google solves this problem.You see this because reactjs use a linting rule that forbids unknown global variables.
What about putting it in your tsconfig?
Most helpful comment
add this line to top of your file:
/*global google*/-> for disable ESLint