Hi I have this routes in App.js
function App() {
return (
<BrowserRouter>
<Switch>
<Route key="products" path="/products" component={Products}></Route>
<Route key="preview" path="/products/:id" component={Preview}></Route>
<Route key="add-product" path="/products/create" component={ProductCreate}></Route>
<Route key="edit-product" path="/products/:id/edit" component={ProductEdit}></Route>
<Route exact path="/" component={Home}></Route>
</Switch>
</BrowserRouter>
);
}
it displays only /products and / others are not displayed they get Products component displayed and I don't understand why. For example my product edit looks like this:
import React from 'react';
const ProductEdit = (props) => {
return(
<div>
<p>Product Edit page</p>
</div>
)
}
export default ProductEdit;
and this is the result I get:
Can't find the problem my self...
