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

87
Visualizações
Route render function not returning or rendering any element

So I am pretty new to React.js and not able to render an element from the Route module. The console is returning that the leaf route at location does not have an element hence renders an empty page. Other Route tags which use "element" function work correctly, so does this one. This is a snippet from the App.js file

          <Route
        path="/"
        render={(props) => (
          <ContactList
            {...props}
            contacts={contacts}
            getContactId={removeContactHandler}
          />
        )}
      />

I have been following a youtube tutorial in hopes of learning React quickly. Now some of the functions used in this tutorial are deprecated currently. So is there a different function that I should be using instead of this? Appreciate any help

Edit: The render and component function both are replaced by element prop, i found this answer helpful

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The React router docs has recently been updated! Meaning syntax has changed. Take a look at this answer here.

about 4 years ago · Juan Pablo Isaza Relatório

0

If anyone wants to know, from version 6 onwards render and component props is replaced by element prop that is passed as a literal instead of through an arrow function ()=>{}. This answer explains it a bit more clearly.

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