HR-FDC-QUASAR / project-greenfield

React e-commerce PDP application
0 stars 6 forks source link

Simplification #96

Open trentgoing opened 4 years ago

trentgoing commented 4 years ago

A bit of an opinion, but:

https://github.com/ptrollins/project-greenfield/blob/80ceadcdf6ab89155872f650c2bb3e16b47251f4/client/src/components/product/overview/styles/Styles.jsx#L67-L81

Although it is a comfortable pattern to define click handlers explicitly, in this case these are a bit unnecessary. Feel free to use the useState callbacks, such as setCurrentQty directly within anonymous functions in your JSX. In the current setup, it is adding additional lines of code without much benefit.

trentgoing commented 4 years ago

@AJBenjumea Same for you here https://github.com/ptrollins/project-greenfield/blob/80ceadcdf6ab89155872f650c2bb3e16b47251f4/client/src/components/product/reviews/ReviewsTileList.jsx#L25-L31