Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

439
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda