`) has to line up. Otherwise, toggling `isActive` would recreate the whole tree below and [reset its state.](/learn/preserving-and-resetting-state) This is why, if a similar JSX tree gets returned in both cases, it is better to write them as a single piece of JSX.
+Tieni presente che se due blocchi JSX diversi descrivono lo stesso albero, il loro annidamento (primo `
` → prima `
![]()
`) deve corrispondere. Altrimenti, attivare/disattivare `isActive` ricreerebbe l'intero albero sottostante e [reimposterebbe il suo state.](/learn/preserving-and-resetting-state) Per questo, se un albero JSX simile viene restituito in entrambi i casi, è meglio scriverlo come un unico blocco JSX.
-#### Profile editor {/*profile-editor*/}
+#### Editor del profilo {/*profile-editor*/}
-Here is a small form implemented with plain JavaScript and DOM. Play with it to understand its behavior:
+Ecco un piccolo form implementato con JavaScript e DOM puro. Gioca con esso per capirne il comportamento:
@@ -801,11 +808,11 @@ label { display: block; margin-bottom: 20px; }
-This form switches between two modes: in the editing mode, you see the inputs, and in the viewing mode, you only see the result. The button label changes between "Edit" and "Save" depending on the mode you're in. When you change the inputs, the welcome message at the bottom updates in real time.
+Questo form passa tra due modalità: in modalità modifica vedi gli input, e in modalità visualizzazione vedi solo il risultato. L'etichetta del pulsante cambia tra "Edit" e "Save" a seconda della modalità in cui ti trovi. Quando modifichi gli input, il messaggio di benvenuto in basso si aggiorna in tempo reale.
-Your task is to reimplement it in React in the sandbox below. For your convenience, the markup was already converted to JSX, but you'll need to make it show and hide the inputs like the original does.
+Il tuo compito è reimplementarlo in React nel sandbox qui sotto. Per comodità, il markup è già stato convertito in JSX, ma dovrai far sì che mostri e nasconda gli input come fa l'originale.
-Make sure that it updates the text at the bottom, too!
+Assicurati di aggiornare anche il testo in basso!
@@ -840,9 +847,9 @@ label { display: block; margin-bottom: 20px; }
-You will need two state variables to hold the input values: `firstName` and `lastName`. You're also going to need an `isEditing` state variable that holds whether to display the inputs or not. You should _not_ need a `fullName` variable because the full name can always be calculated from the `firstName` and the `lastName`.
+Avrai bisogno di due variabili di state per memorizzare i valori degli input: `firstName` e `lastName`. Avrai anche bisogno di una variabile di state `isEditing` che indica se mostrare gli input o meno. Non dovresti _aver bisogno_ di una variabile `fullName` perché il nome completo può sempre essere calcolato da `firstName` e `lastName`.
-Finally, you should use [conditional rendering](/learn/conditional-rendering) to show or hide the inputs depending on `isEditing`.
+Infine, dovresti usare la [renderizzazione condizionale](/learn/conditional-rendering) per mostrare o nascondere gli input a seconda di `isEditing`.
@@ -900,13 +907,13 @@ label { display: block; margin-bottom: 20px; }
-Compare this solution to the original imperative code. How are they different?
+Confronta questa soluzione con il codice imperativo originale. In cosa differiscono?
-#### Refactor the imperative solution without React {/*refactor-the-imperative-solution-without-react*/}
+#### Rifattorizzare la soluzione imperativa senza React {/*refactor-the-imperative-solution-without-react*/}
-Here is the original sandbox from the previous challenge, written imperatively without React:
+Ecco il sandbox originale della sfida precedente, scritto in modo imperativo senza React:
@@ -1003,9 +1010,9 @@ label { display: block; margin-bottom: 20px; }
-Imagine React didn't exist. Can you refactor this code in a way that makes the logic less fragile and more similar to the React version? What would it look like if the state was explicit, like in React?
+Immagina che React non esista. Riesci a rifattorizzare questo codice così che la logica sia meno fragile e più simile alla versione React? Come sarebbe se lo state fosse esplicito, come in React?
-If you're struggling to think where to start, the stub below already has most of the structure in place. If you start here, fill in the missing logic in the `updateDOM` function. (Refer to the original code where needed.)
+Se fai fatica a capire da dove iniziare, lo stub qui sotto ha già la maggior parte della struttura. Se parti da lì, completa la logica mancante nella funzione `updateDOM`. (Fai riferimento al codice originale dove serve.)
@@ -1112,7 +1119,7 @@ label { display: block; margin-bottom: 20px; }
-The missing logic included toggling the display of inputs and content, and updating the labels:
+La logica mancante includeva l'attivazione/disattivazione della visualizzazione di input e contenuto, e l'aggiornamento delle etichette:
@@ -1229,7 +1236,7 @@ label { display: block; margin-bottom: 20px; }
-The `updateDOM` function you wrote shows what React does under the hood when you set the state. (However, React also avoids touching the DOM for properties that have not changed since the last time they were set.)
+La funzione `updateDOM` che hai scritto mostra cosa fa React sotto il cofano quando imposti lo state. (Tuttavia, React evita anche di toccare il DOM per le proprietà che non sono cambiate dall'ultima volta che sono state impostate.)
diff --git a/src/sidebarLearn.json b/src/sidebarLearn.json
index de4ab20a2..e3b6b1e5f 100644
--- a/src/sidebarLearn.json
+++ b/src/sidebarLearn.json
@@ -169,7 +169,7 @@
],
"routes": [
{
- "title": "Reacting to Input with State",
+ "title": "Reagire all'input con lo State",
"path": "/learn/reacting-to-input-with-state"
},
{