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

437
Views
this map would not have to revolve 2 hello?

I'm practicing the map function and I don't understand why it doesn't return 2 hellos, what am I doing wrong?

I have no answer, what can I be doing wrong?

const Books = [
  {
    img: imagen,
    title: "murakami",
    año: 2022,
    genero: "terror",
    edicion: "ivrea",
  },
  {
    img: imagen2,
    title: "Joe hill",
    año: 2022,
    genero: "aventura",
    edicion: "panini",
  },
];

function BookList() {
  return (
    <section>
      {Books.map((book) => {
        return "Hello";
      })}
    </section>
  );
}

function App() {
  return <div>{BookList}</div>;
}

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

0

BookList is a component, but you are treating it as a react node. This works fine for types that can be react nodes: strings, numbers, or other Components work fine:

function App() {
  const content = "hello hello";
  return <div>{content}</div>;
}

What you are actually doing is trying to make an uncalled function a child of a react component. This is incorrect and should result in a runtime error.

return <div><BookList /></div> should do the trick, the JSX calls your component function, which should display it.

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!