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

206
Visualizações
No routes matched location "/products"

I am creating a site in react that has an initial authentication page, and a protected route to the administration panel that is shown when the user is logged in.

 //route for authentication
 <Route exact path="/" element={<AuthLayout />}>
       <Route index element={<Login />} />
 </Route>

  //route for for the board
 <Route path="/admin" element={<RutaProtegia />}>
     <Route index element={<Home />} />
     <Route path="products">
            <Route index element={<List />} />
            <Route path=":productId" element={<Single />} />
            <Route
            path="new"
            element={<New inputs={productInputs} title="Add New Product" />}
            />
     </Route>
</Route>

The protected route contains the validation on whether the user exists and based on this it shows an <Outlet/>

import { Outlet, Navigate } from "react-router-dom"
import useAuth from "../hooks/useAuth"

export const RutaProtegia = () => {

    const { auth, cargando } = useAuth();

    return (
        <>
            {auth?._id ? <Outlet /> : <Navigate to="/" />}
        </>

    )
}

The error is generated when trying to enter the /products route, it is at this point where the console shows me the following error No routes matched location "/products"

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