skip to Main Content

Reactjs – I can't render my ProductList wih react-route-dom

<Col xs="9"> <Routes> <Route exact path="/" render={(props) => ( <ProductList {...props} products={this.state.products} addToCart={this.addToCart} currentCategory={this.state.currentCategory} info={productInfo} /> )} /> This is my App.js file. it doesn't work. I looked react-router-dom old version and some place we must replace switch to routes.…

VIEW QUESTION

ReactJS Router Options and splats in a nested route

I have the following nest route: createRoutesFromElements(<> <Route path="/:siteid/:route?/login/:cmd?/:id?" element={< LoginLayout/>}> <Route ... /> <Route ... /> <Route path="/:siteid/:route?/login/:cmd?/:id?" element={< LoginPage />} /> </Route> <Route...more routes /> </>) ) But I get the following error: Absolute route path "/:siteid/:route/login/:cmd" nested…

VIEW QUESTION
Back To Top
Search