DEV Community

Mayank
Mayank

Posted on

Answer: Nested Object not showing the component

Following place is where you are making mistake.

{
teacher.map((thr) =&gt
  thr.students.map((stu) => { // this map is not returning anything
    <Avatar color="red" key={stu.id} component={Link} to="/complete">
      {stu.studentName}
    </Avatar>;
  })
)
}

add a return statement or remove { curly braces.

{
teacher.map((thr) =>
  thr.students.map((stu) => (
    <Avatar color="red" key={stu.id} component={Link}

Top comments (0)