this is my App.js Component
<Routes>
<Route path='/products/:id' element={<ProductDetails/>} />
// other <Route />
</Routes>
and this is my ProductDetails Component
const ProductDetails = (props) => {
const id = props.match.params.id
return (
<div>
<h1> {id} </h1>
</div>
);
};
but i got this error = TypeError: Cannot read properties of undefined (reading 'params')
what should I do??