adrianhajdin / project_travel_advisor

Tutorial created in collaboration with Enyel Sequeira, taught by JavaScript Mastery.
MIT License
2.01k stars 444 forks source link

Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'filter') #32

Closed jazer313 closed 2 years ago

jazer313 commented 2 years ago

Getting the error below, any suggestions to fix it?

Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'filter') (anonymous function) src/App.js:45 ` getPlacesData(type, bounds.sw, bounds.ne) .then((data) => { setPlaces(data.filter((place) => place.name && place.num_reviews > 0)); setFilteredPlaces([]); setRating(''); setIsLoading(false);