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

401
Views
Error: Objects are not valid as a React child (found: object with keys

Hi guys if you can help me understand what I'm doing wrong?

This error notes:

Error: Objects are not valid as a React child (found: object with keys {id, title, bodyText, icon}). If you meant to render a collection of children, use an array instead.

My code snippet:

  if (cards) {
    const filteredCards = cards.filter((card: { title: string }) => {
      return card.title.toLowerCase();
    });
    return filteredCards;
  }

console.log(cards) gives:

cards (4) [{…}, {…}, {…}, {…}]

if I'm using an array there as the error notes, isn't this redundant?

I'm kind of confused.

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

0

You should return an array of JSX or an array of strings. I guess you meant to get the lowerCase of titles. For that, you should be using map instead of filter. Currently filteredCards is an array of JSON in the format same as an item cards.

Try like this.

  if (cards) {
    const filteredCards = cards.map((card: { title: string }) => {
      return card.title.toLowerCase();
    });
    return filteredCards;
  }
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!