I am trying to use the DistanceMatrixService from @react-google-maps/api. One of the required parameters is the 'travelMode'. However, when I tried setting 'travelMode' to 'DRIVING', it shows the following!
I tried doing travelMode: google.maps.TravelMode.DRIVING but it also throws a type error
TypeError: Cannot read properties of undefined (reading 'maps')
Here is a snippet of my code where I call the Distance Matrix Service.