Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
I'm migrating my JSX site to TSX and don't understand how to place my type definitions

Just like the title says I am migrating an app that I created that uses the Google Maps API to render the map and from there I show some information on maps and have some function to pan in if the user clicks something.

the error code that I am getting is this.

Type '{ lat: () => number; lng: () => number; }' is missing the following properties from type 'LatLng': equals, toJSON, toUrlValue

This is the code that is generating the error.

  const {
    ready,
    value,
    suggestions: { status, data },
    setValue,
    clearSuggestions,
  } = usePlacesAutocomplete({
    requestOptions: {
      location: { lat: () => 40.7703, lng: () => -73.9883 }, // This line specifically
      radius: 50 * 1000,
    },
  }); 

This is the panTo function that search is taking into account.

const panTo = React.useCallback(({ lat, lng }) => {
    mapRef.current.panTo({ lat, lng });
    mapRef.current.setZoom(14);
  }, []);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

See the documentation for the AutocompletionRequest interface used by requestOptions. The location property is required to be an instance of google.maps.LatLng

usePlacesAutocomplete({
  location: new google.maps.LatLng(40.7703, -73.9883),
  radius: 50 * 1000,
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!