Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Nested mapping in 3 arrays with React

The mapping works so far. The problem I have is that I don't really need the middle array or its return. I want a stack with multiple avatars depending on the number of friends. I currently get everything twice.

enter image description here

  <React.Fragment>
      {eintrag.kalenderEinträge ? (
        eintrag.kalenderEinträge.map((e, i) => {
        var d1 = tag;
        var d2 = Moment(e.datum).format("L");

        if (d1 === d2) {
           return e.freunde?.map((f, i) => {
              return (
                    <Stack
                     spacing={1}
                     sx={{
                     marginTop: 3,
                     backgroundColor: "rgba(39, 187, 245, 0.05)",
                     }}
                     m={2}
                     >
             <Box sx={{ display: "flex" }} p={1}>
               <AvatarGroup max={2}>
                {e.freunde?.map((f, i) => {
                    let img = `data:${f.typ};base64,${f.bild}`;
                       return (
                             <Avatar
                              alt={f.name}
                              src={img}
                              sx={{
                              width: 56,
                              height: 56,
                              }}
                              />
                          );
                      })}
                  </AvatarGroup>

                 ... 

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!