assigment by shivamg11000(shivam gupta)#5
assigment by shivamg11000(shivam gupta)#5shivamg11000 wants to merge 1 commit intojavascripters-community:masterfrom
Conversation
|
Good Job @shivamg11000. We will review it after the contest. |
akshaynaik404
left a comment
There was a problem hiding this comment.
Convert components using Class syntax to Stateless functional Components and use camelcase naming convention.
| import React from 'react'; | ||
| import './Cart.css'; | ||
|
|
||
| class Cart extends React.Component{ |
There was a problem hiding this comment.
This Component can be converted to a Stateless Functional Component. Just like the others. For more info Click Here
| } | ||
|
|
||
| handleAddToCart(itemKey){ | ||
| const no_of_cart_items = this.state.cart.no; |
There was a problem hiding this comment.
Camel case is preferred in JavaScript based projects. Corresponding Airbnb style guide rule
There was a problem hiding this comment.
I know but for such big variables snake case is more readable
There was a problem hiding this comment.
What do you think about this react lifecycle method then - `componentWillReceiveProps()'?
There was a problem hiding this comment.
ofcourse we have to use it , snakecase will not work here
There was a problem hiding this comment.
I was trying to convey that "componentWillRecieveProps" is long variable name and yet camel case is used here.
|
|
||
|
|
||
|
|
||
| class OrderSummary extends React.Component{ |
There was a problem hiding this comment.
This class can also be converted to Stateless functional component.
|
|
||
| import './Shop.css'; | ||
|
|
||
| class Shop extends React.Component{ |
There was a problem hiding this comment.
This class can also be converted to a Stateless functional components
|
|
||
| import './ShopItem.css'; | ||
|
|
||
| class ShopItem extends React.Component{ |
There was a problem hiding this comment.
Convert all classes that either does not have state or won't have state in future, to a stateless functional component.
javascripters2015
left a comment
There was a problem hiding this comment.
Please add comment wherever required to understand the code implementation intention
Make code more readable
Update README file with all required instruction to setup project.
done the assignment, took the same idea of e-commerce and implemented it.