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

Feature: Restaurant State #9

Open
1 task done
RbAvci opened this issue Feb 24, 2024 · 0 comments
Open
1 task done

Feature: Restaurant State #9

RbAvci opened this issue Feb 24, 2024 · 0 comments

Comments

@RbAvci
Copy link
Owner

RbAvci commented Feb 24, 2024

From React-Module-Project created by SallyMcGrath: CodeYourFuture#9

Instructions:

Working in Restaurant component

At the moment, the number of pizzas a guest can order is static and set to 0, even if they click on the 'Add' button. We will change that in the following to let a guest add more pizzas to their order. First, declare a new state variable orders along with the function to set the orders state setOrders. The initial value of the orders state should be 0. Use the new orders variable instead of the pizzas variable (that you can now delete).

Hint: You need to use the React function useState to create a state variable. Remember to import the function at the top with import React, {useState} from "react";.

Test:

  • The number of ordered pizzas is still 0 on the screen.
@RbAvci RbAvci moved this to 📋 Backlog in React Module Project Mar 1, 2024
@RbAvci RbAvci moved this from 📋 Backlog to 🔖 Ready in React Module Project Mar 4, 2024
@RbAvci RbAvci self-assigned this Mar 4, 2024
@RbAvci RbAvci moved this from 🔖 Ready to 🏗 In progress in React Module Project Mar 5, 2024
@RbAvci RbAvci moved this from 🏗 In progress to 👀 In review in React Module Project Mar 5, 2024
@RbAvci RbAvci moved this from 👀 In review to ✅ Done in React Module Project Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant