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>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>