Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Each child in a list should have a unique "key" prop. #59

Open
ishak52 opened this issue Sep 11, 2019 · 0 comments
Open

Each child in a list should have a unique "key" prop. #59

ishak52 opened this issue Sep 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working done priority 1

Comments

@ishak52
Copy link
Contributor

ishak52 commented Sep 11, 2019

Each child in the categories list should have a unique "key" prop.
in emarket/client/src/components/Category/index.js file

this.state.result.map(e => (
          <Link to={'/shop/'+e.id }>
            <div onClick={this.props.onClick}>
              <img className="grid-item" src={e.img} />
              <p className="category">{e.name}</p>
            </div>
            </Link>

Add key={e.id} to <Link to={'/shop/'+e.id }> to solve the problem.

Same thing for
/emarket/client/src/components/Product_card/index.js file

myProducts.map(e=>(
  <Link to={ '/product/' + e.id }><div className="cards">
  <div className="product-card-back" >
      <div className="product-card" >
      <img className="product-img" src={e.img} alt="product-img"/>
      <p className="product-name">{e.name}</p>
      <p className="product-price">₪ {e.price}</p>
    </div>
  </div>
  </div>
  </Link>

To solve this add key={e.id} to <Link to={ '/product/' + e.id }>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done priority 1
Projects
None yet
Development

No branches or pull requests

5 participants