I want to send mapped data as props to another component.

My code looks like this:

```
<div className={styles.myTeamFlex}>
  {userTeams.map((team, index) => (
    <TeamCard
      key={team + index}
      active={active}
      index={index}
      data={team}
      teamRoles={userTeamRoles}
      setactive={setactive}
    />
  ))}
</div>;

```

and I want to fetch this data in another component as well like I have another  

component and I exported the above component in that component but map method doesn't work and throws
an error:

```
Cannot read property 'map' of undefined

```

How can I do that?