<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. But any changes didn’t change the result. I can’t see my ProductList component.
"react-router-dom": "6.23.0"
2
Answers
I know this version but it didn't work, here is my whole code attached.
Git: https://github.com/enesagu/node.js_meteor.js_react/blob/main/react_project/intro/src/App.js
App.js:
It works now thank you
In React Router DOM version 6, the component is used to define your routes, and the component is used to render a component for a specific route. Here’s how you can update your App.js file to work with React Router DOM version 6: