'"Matched leaf route at location "/" does not have an element"
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} /> )} />
Solution 1:[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
} />}/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ?smail Can Karata? |
