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

181
Views
Not Rendering Component From Iterated Array in JSX

I have a project variable which follows this structure:

[
    org_id_1: {
        project_id_1: {
            title: ...
        },
        project_id_2: {
            title: ...
        }
    },
    org_id_2: {
        ...
    }
]

In my JSX, I want to display a ProjectCard component for each extracted project. I successfully loop through this structure to each individual project, but the component does not render. My code:

<div className='flexbox...'>
    {
        projects && Object.keys(projects).map(organisationId => {
            const projectsArray = projects[organisationId]
            projectsArray.map(project => {
                return <ProjectCard key={project.id} project={project} />
            })
        })
    }
</div>

I know for sure that I'm iterating through the projects because when I console.log(project), or console.log(project.title) just before the return statement, I can see the correct values show up.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try returning the outer map as the inner scope has a correct return but the outer one isn't returning anything

about 4 years ago · Juan Pablo Isaza Report

0

You are suppose to put a return inside the .map()

about 4 years ago · Juan Pablo Isaza Report
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!