Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

336
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda