CodeYourFuture / CodeYourFuture/React-Module-Project

Feature Restaurant State

未关闭
#9 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
🏕 Priority Mandatory 📅 Week 2 🦔 Size Tiny
主要语言
JavaScript
星标
1
派生
28
PR 合并指标
30 天内没有已合并 PR

描述

**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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。