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

182
Views
TypeError: no se pueden leer las propiedades de undefined (leyendo 'mapa') - Tutorial de clonación de AirBnb

¿Alguien sabe por qué recibo el siguiente tipo de error? Estoy siguiendo este tutorial (alrededor de 59 minutos): https://www.youtube.com/watch?v=G5mmrBkCaP8

Aquí está mi código:

 import React, { useState } from 'react'; import ReactMapGL from 'react-map-gl'; import { getCenter } from 'geolib'; function Map({ searchResults }) { const coordinates = searchResults.map((result) => ({ longitude: result.long, latitude: result.lat, })); // The latitude and longitude of the center of the coordinates const center = getCenter(coordinates); const [viewport, setViewport] = useState({ width: "100%", height: "100%", latitude: center.latitude, longitude: center.longitude, zoom: 10, }); return ( <ReactMapGL mapStyle='mapbox://styles/shesonanadventure/cl063x0yl000r15n4frjpm9in' mapboxAccessToken={process.env.mapbox_key} {...viewport} onViewportChange={(nextViewport) => setViewport(nextViewport)} ></ReactMapGL> ); } export default Map;

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

SearchResults no está definido.

Haz searchResults && searchResults.map

También asegúrate de pasar el accesorio.

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!