'React-router-dom sending props
I have a problem sending props using react-router-dom. I'm getting this error:
Matched leaf route at location
"/"does not have an element. This means it will render an<Outlet />with a null value by default resulting in an "empty" page."
<Routes>
<Route
exact
path="/"
render={routeProps => (
<ProductList
{...routeProps}
products={this.state.products}
addToCart={this.addToCart}
currentCategory={this.state.currentCategory}
info={productInfo}
/>
)}
/>
<Route exact path="/cart" element={<CartList />} />
<Route path="*" element={<NotFound />} />
</Routes>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
