Grocery App


React Components Public New

Easy 

20min


You have a GroceryApp class, which receives a list of products, each one with name and votes. The app should render an unordered list, with a list item for each product. Products can be upvoted or downvoted.

By appropriately using React state and props, implement the upvote/downvote logic. Keep the state in the topmost component, while the Product component should accept props.

HTML5, CSS3
   

Run OK, but 3 out of 3 test cases fail:

  •   GroceryApp should render a list item for each product: Wrong answer
  •   Clicking on "+" button increases product votes: Exception
  •   Clicking on "-" button decreases product votes: Exception