-
Notifications
You must be signed in to change notification settings - Fork 1
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
NW6| Rabia Avci | React Module Project | Feature Restaurant-State - Week2 #41
Conversation
Updated component to use 'orders' for ordering functionality Deleted the old 'pizzas' variable
✅ Deploy Preview for cyf-react-hotel-project ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general good work!
const Restaurant = () => { | ||
const pizzas = 0; | ||
const [orders, setOrders] = useState(0); | ||
const handleAddOrder = () => { | ||
setOrders(orders + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nothing would change if you omit the const pizzas = 0; Since the pizzas variable is not used anywhere in the component, removing it would simplify the code without affecting its functionality.
Good Work! |
Orders: {orders} | ||
<button className="button restaurant__button" onClick={handleAddOrder}> | ||
Add | ||
</button> | ||
</li> | ||
</ul> | ||
</section> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great :)
Learners, PR Template
Self checklist
Changelist
Questions
Ask any questions you have for your reviewer.