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

119
Views
Reaccionar enrutador con contexto

Estoy ajustando algunas rutas privadas con un contexto, pero por alguna razón no pasa a la siguiente ruta en el conmutador.

 export const Routes = () => ( <Switch> <Route exact path="/" component={Home} /> <Route path="/seller/:userName" component={userProfile} /> <Route path="/allproducts" component={AllProducts} /> <Route path="/privacy" component={Privacy} /> <Route path="/terms" component={Terms} /> <Route path="/contact" component={Contact} /> <Route path="/about" component={About} /> <Route path="/learnmore" component={LearnMore} /> <Route path="/faq" component={FAQ} /> <PublicRoute path="/login" component={Login} /> <PublicRoute path="/signup" component={SignUp} /> <PublicRoute path="/reset" component={ForgotPassword} /> <PublicRoute path="/resetToken" component={ForgotPasswordToken} /> <PrivateRoute exact path="/userprofile" component={UserDashboard} /> <PrivateRoute exact path="/submitplate" /> // This works but doesn't allow the router to move to the next potential route. <BasketProvider> <PrivateRoute exact path="/checkout" component={Checkout} /> </BasketProvider> // This never gets reached. <Route component={NoMatchPage} /> </Switch> );

Solo me pregunto si hay una mejor manera de evitar esto. ¿Es esta una mala práctica?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Funciona si haces esto?

 <PrivateRoute exact path="/checkout" component={() => ( <BasketProvider> <Checkout /> </BasketProvider> )} />
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!