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

117
Views
how to display object data in react with map method

const [data, setData] = useState({dataOne: "", dataTwo: ""});

How can i render both object values in One react table?

Here's Json Response

dataOne

[{
    "name": "adnan hassan",
    "count": 6960
}, {
    "name": "adnan",
    "count": 69666660
}]

dataTwo

[{
    "metrics": {
        "competition": "LOW",
        "avg_searches": "6600",
        "competition_index": "22"
    },
    "keyword_annotations": {
        "concepts": []
    },
    "text": "dubai homes"
}]

i want to show Count from dataOne & avg_searches, text from dataTwo in table. Map method Working one by one Like this data.dataOne.map() & data.dataTwo.map() But i want to render both values in one method like data.map()

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

0

You can merge the two arrays: using:

mergedArray = [...arr1, ...arr2]

dataOne = [{
    "name": "adnan hassan",
    "count": 6960
}, {
    "name": "adnan",
    "count": 69666660
}]

dataTwo = [{
    "metrics": {
        "competition": "LOW",
        "avg_searches": "6600",
        "competition_index": "22"
    },
    "keyword_annotations": {
        "concepts": []
    },
    "text": "dubai homes"
}]

let merged = [...dataOne, ...dataTwo]
console.log(merged)

// Then after you can map the data based on what you want
console.log('--mapped data starts here--')
merged.map((val) => {
  console.log(val)
})

about 4 years ago · Juan Pablo Isaza Report

0

Thank you @Cypherjac for your direction. i solved this problam with https://lodash.com/docs/4.17.15#mergeWith

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!