2021年1月20日星期三

No overload matches this call.in react

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;
https://stackoverflow.com/questions/65819823/no-overload-matches-this-call-in-react January 21, 2021 at 09:06AM

没有评论:

发表评论