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

78
Views
Iterating some results from api and database and matching

So I want to iterate results and also iterate movies at the same time not like I'm doing, and pass the movie object only if it matches, because sometimes I get undefined.

code:

{results.map((result) => (
        <Thumbnail
          key={result.id}
          result={result}
          movie={movies.find((movie) => movie.tmdb_id === result.id)}
        />
      ))}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can create another component to filter the data first then pass it down to your thumbnail component like this:

function YourFunction(props){
return(
  <ul>
    {
     results
     .filter(result => result.id = {props.id})
     .map(movie => <Thumbnail key={movie.id} result={movie} />
    }
  </ul>
   )
}
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!