john-smilga / react-projects

4.85k stars 3.88k forks source link

tours.map is not a function #13

Closed Azeem-Dev closed 3 years ago

Azeem-Dev commented 3 years ago

Running your second project (actually following you on youtube) whenever I pass tours={tours} to the Tours component and In Tours component whenever I try to make a map of the current array it say tours.map is not a function

https://github.com/john-smilga/react-projects/blob/14e830c9eecd2ad68e612de70232b82510a3fa89/2-tours/final/src/Tours.js#L12

Azeem-Dev commented 3 years ago

Okay found the answer it seems you have to initialize the tours to an empty array not an empty string