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

334
Visualizações
How to use Suspense with React-Router-Dom v6?

I'm trying to migrate react-router-dom from v5 to v6 and I'm having a trouble, here is my implementation with using Suspense

<Suspense
   fallback={
     <div className="center-div">
        <LoadingDots />
     </div>
   }
>
    <Routes>
        {routes.map((route, index) => (
           <Route
              path={route.path}
              key={route.path}
              element={lazy(() => import("./features/apps/AppsListPage"))} //it is route.component but for simplify example i'm show it like this
          />
        ))}
    </Routes>
</Suspense>

can someone tell me why browser return me this kind of error?

index.tsx:13 Error: Objects are not valid as a React child (found: object with keys {$$typeof, _payload, _init}). If you meant to render a collection of children, use an array instead.

I think that it caused by using lazy in element prop, but can i fix this?

Thanks for any help!

about 4 years ago · Juan Pablo Isaza
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