Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda