const libraries = ['drawing', 'places', 'geometry'];
const {isLoaded, loadError } = useLoadScript({ googleMapsApiKey: '', libraries: libraries })
Asked
Active
Viewed 577 times
0

Mostafa Yasser
- 145
- 1
- 2
- 7
-
I've tried many solutions, the first was to make libraries as a constant value out of the parent function, but typescript keeps showing the same error which is: Type 'string[]' is not assignable to type '("drawing" | "places" | "geometry" | "localContext" | "visualization")[]'. – Mostafa Yasser Jun 08 '22 at 13:44
-
the second solution was using React.useRef() to make a reference to the libraries value, but that also shows the same error. – Mostafa Yasser Jun 08 '22 at 13:47