Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
react-router no me envía al componente correcto

cuando trato de ir a "shop/checkout/" obtengo el "/:current/:project" (obtengo ProjectPage y no CheckoutPage) ¿qué estoy haciendo mal? el "/: actual" proviene del componente de diseño.

 <Switch location={location}> <Route exact path="/design" component={Design} /> <Route exact path="/shop" component={Shop} /> <Route exact path="/:current/:project" component={ProjectPage}/> <Route exact path="/shop/checkout" component={CheckoutPage}/> </Switch> design page: <Link to={`${useLocation().pathname}/${title}`} /> //useLocation = "/design", ${title} is a project name, im maping through projects and when the user click a project it uses the name of the project to the url shop: <Link to="/shop/checkout">CHECKOUT</Link>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Es porque la tienda y el pago se leen como parámetros. Luego representa el componente ProjectPage.

Simplemente coloque la ruta /shop/checkout antes de su ruta dinámica con parámetros.

 <Switch location={location}> <Route exact path="/design" component={Design} /> <Route exact path="/shop" component={Shop} /> <Route exact path="/shop/checkout" component={CheckoutPage}/> <Route exact path="/:current/:project" component={ProjectPage}/> </Switch>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!