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

327
Views
Why in React js Map() method is not working

If I use console.log it is printing all values perfectly and also if I pass these props one by one then it works perfectly fine but this map is not working her is my code:

` import Card from './Components/Card'; import './App.css'

const data = [
  {
    id : "1",
    title : "DARK",
    image : require("./Images/potrait1.jpg")
  },
  {
    id : "2",
    title : "DARK",
    image : require("./Images/potrait8.jpg")
  },
  {
    id : "3",
    title : "DARK",
    image : require("./Images/potrait4.jpg")
  },
  {
    id : "4",
    title : "DARK",
    image : require("./Images/potrait5.jpg")
  },
  {
    id : "5",
    title : "DARK",
    image : require("./Images/potrait6.jpg")
  },
  {
    id : "6",
    title : "DARK",
    image : require("./Images/potrait7.jpg")
  }
]

let App = ()=>{

{data.map((val)=>{

      return(
            <Card
              key = {val.id} 
              title = {val.title}
              image = {val.image}
            />
        );

  })}
}

export default App;

`

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

0

Replace {} with (). Try this

    let App = ()=> (
    {data.map((val)=>{

      return(
        <Card
          key = {val.id} 
          title = {val.title}
          image = {val.image}
        />
      );

     })}

)

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!