TypeError: Cannot read properties of undefined (reading 'map') even though This components works in another component

Viewed 13

I am new to Coding. So please make it as simple as ABC I am begging!

MeetupList.js:6 Uncaught TypeError: props.map is not a function at MeetupList (MeetupList.js:6:1)

The background to the question is this - from the React Crash Course for Beginners 2021 - Learn ReactJS from Scratch on Youtube.

This is a meetup page and on the homepage, if I click on add to Favorite it works (and the badge on the My Favorites nav bar indicates this (but if I go to the My Favorites page, the screen goes blank). The screen goes blank even if I go straight to the Fav page. I will post the code here;

import MeetupItem from './MeetupItems';
import classes from './MeetupList.module.css';

function MeetupList(props) {
  return (
    <ul className={classes.list}>
      {props.meetups.map((meetup) => (
        <MeetupItem
          key={meetup.id}
          id={meetup.id}
          image={meetup.image}
          title={meetup.title}
          address={meetup.address}
          description={meetup.description}
        />
      ))}
    </ul>
  );
}

export default MeetupList;

You can get the rest of the codes here ---> https://github.com/academind/react-complete-guide-code/tree/zz-reactjs-summary/code/19-finished/src/components

0 Answers
Related