HI I AM GETTING THIS ERROR
D:/Downloads/Uber-Website-Clone-master/src/App.tsx TypeScript error in D:/Downloads/Uber-Website-Clone-master/src/App.tsx(17,7): No overload matches this call. Overload 1 of 2, '(props: Readonly): LoadScript', gave the following error. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. Overload 2 of 2, '(props: LoadScriptProps, context?: any): LoadScript', gave the following error. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. TS2769
15 | <div className="App"> 16 | <LoadScript
17 | googleMapsApiKey={process.env.REACT_APP_GOOGLE_TOKEN} | ^ 18 | libraries={['places']} 19 | > 20 |
HERE IS CODE
import React, { useEffect } from 'react'; import { LoadScript } from '@react-google-maps/api'; import './global.css'; import CoordinatesProvider from './context/coordinates'; import Header from './components/Header'; import Map from './components/Map'; import Search from './components/Search'; function App() { return ( <div className="App"> <LoadScript googleMapsApiKey={process.env.REACT_APP_GOOGLE_TOKEN} libraries={['places']} > <CoordinatesProvider> <Header /> <Search /> <Map /> </CoordinatesProvider> </LoadScript> </div> ); } export default App;
没有评论:
发表评论