Feature Restaurant State

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, react
Ambito
frontend

Direzione di ricerca

Inizia dal componente Restaurant e controlla come vengono utilizzati il valore pizzas attuale e il pulsante Add. Importa useState di React, crea orders con un valore iniziale pari a 0 e rimuovi la variabile pizzas. Verifica che il numero di pizze ordinate continui a essere visualizzato come 0 sullo schermo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🏕 Priority Mandatory 📅 Week 2 🦔 Size Tiny

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.
Lingua principale
JavaScript
Stelle
1
Fork
28
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CodeYourFuture/React-Module-Project

Tutte le issue di CodeYourFuture/React-Module-Project

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.