0

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. I have this error in my console.

<Route exact path="/" render= { props => ( <ProductList {...props} products={this.state.products} addToCart={this.addToCart} curretCategory={this.state.curretCategory} info={productInfo} /> )} />
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • Does this answer your question? [Matched leaf route at location "/" does not have an element](https://stackoverflow.com/questions/69854011/matched-leaf-route-at-location-does-not-have-an-element) – jonrsharpe Mar 03 '22 at 11:28

1 Answers1

1

I was dealing with the same code, this place will help you.

LINK : https://stackoverflow.com/a/71602986/17546497

CODE:

<Route
  exact
  path="/"
  element={< ProductList products = {
  this.state.products
}
currentCategory = {
  this.state.currentCategory
}
addToCart = {
  this.addToCart
}
info = {
  productInfo
} />}/>