CodeYourFuture / CodeYourFuture/React-Module-Project

Feature Restaurant State

Aberta
#9 0 comentários 0 reações 0 responsáveis Ver no GitHub
🏕 Priority Mandatory 📅 Week 2 🦔 Size Tiny
Linguagem predominante
JavaScript
Estrelas
1
Forks
28
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.