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

172
Vistas
showing white screen when put content in <Route> tag in react

the code showing white screen , even not showing header and footer . but when I remove a code in route tag , it shaw header and footer .

<><BrowserRouter>

  <Header title="My Todos List" searchBar={false} />
  <Routes>
    <Route exact path="/" render={() => {
      return (
        <>
          <Addtodo addTodo={addTodo} />
          <Todos todos={todos} onDelete={onDelete} />
        </>)
    }}>
    </Route>
    <Route exact path="/about">
      <About />
    </Route>
  </Routes>
  <Footer />

</BrowserRouter>
</>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

It seems you are mixing up the react-router-dom v5 Route API while using v6. The Route component doesn't take a component or render props, and only other Route components can be a child of a Route. They now take only an element prop that takes a ReactElement, a.k.a. JSX. Also gone is the exact prop. In RRDv6 routes are now always exactly matched.

<BrowserRouter>
  <Header title="My Todos List" searchBar={false} />
  <Routes>
    <Route
      path="/"
      element={(
        <>
          <Addtodo addTodo={addTodo} />
          <Todos todos={todos} onDelete={onDelete} />
        </>
      )}
    />
    <Route path="/about" element={<About />} />
  </Routes>
  <Footer />
</BrowserRouter>
about 4 years ago · Juan Pablo Isaza Denunciar

0

I have also encountered similar problems to you before. Does the content in the routing block the Header and Footer. you can change style of layout

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