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

TypeError: Cannot read property 'map' of undefined #179

Open
bryar323 opened this issue Feb 28, 2019 · 0 comments
Open

TypeError: Cannot read property 'map' of undefined #179

bryar323 opened this issue Feb 28, 2019 · 0 comments

Comments

@bryar323
Copy link

my issues:
TypeError: Cannot read property 'map' of undefined

my code:

`import React, { Component } from "react";
import Product from "./Product";
import Title from "./Title";
import { storeProducts } from "../data";
import { ProductConsumer } from "../context";
export default class ProductList extends Component {
state = {
products: storeProducts
};

render() {
return (
<React.Fragment>



<Title name="our" title="products" />

        <div className="row">
          <ProductConsumer>
            {value => {
              return value.products.map(product => {
                return <Product key={product} product={product} />;
              });
            }}
          </ProductConsumer>
        </div>
      </div>
    </div>
  </React.Fragment>

  //
);

}
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant