You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/tutorial-tic-tac-toe.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1133,11 +1133,7 @@ Chiamare la funzione `setSquares` consente a React di sapere che lo stato del co
1133
1133
1134
1134
<Note>
1135
1135
1136
-
<<<<<<< HEAD
1137
1136
JavaScript supporta le [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures), il che significa che una funzione interna (ad es. `handleClick`) ha accesso a variabili e funzioni definite in una funzione esterna (ad es. `Board`). La funzione `handleClick` può leggere lo state `squares` e chiamare il metodo `setSquares` perché sono entrambi definiti all'interno della funzione `Board`.
1138
-
=======
1139
-
JavaScript supports [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures) which means an inner function (e.g. `handleClick`) has access to variables and functions defined in an outer function (e.g. `Board`). The `handleClick` function can read the `squares` state and call the `setSquares` method because they are both defined inside of the `Board` function.
Copy file name to clipboardExpand all lines: src/content/learn/updating-objects-in-state.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ setPosition({
199
199
200
200
Mutare è un problema solo quando modifichi oggetti *esistenti* che sono già nello state. Mutare un oggetto che hai appena creato va bene perché *nessun altro codice lo utilizza ancora.* Modificarlo non impatterà accidentalmente qualcosa che dipende da esso. Questa si definisce come "mutazione locale". Puoi persino mutare localmente [durante la renderizzazione.](/learn/keeping-components-pure#local-mutation-your-components-little-secret) Molto comodo e perfettamente valido!
201
201
202
-
</DeepDive>
202
+
</DeepDive>
203
203
204
204
## Copiare gli oggetti con la sintassi di spread {/*copying-objects-with-the-spread-syntax*/}
205
205
@@ -379,11 +379,7 @@ Nota che la sintassi di spread `...` è "superficiale", cioè copia solo il prim
379
379
380
380
#### Usare un singolo event handler per più campi {/*using-a-single-event-handler-for-multiple-fields*/}
381
381
382
-
<<<<<<< HEAD
383
382
Puoi anche usare le parentesi `[` e `]` dentro alla definizione dell'oggetto per specificare una proprietà con nome dinamico. Ecco lo stesso esempio, ma con un solo event handler invece di tre:
384
-
=======
385
-
You can also use the `[` and `]` braces inside your object definition to specify a property with a dynamic name. Here is the same example, but with a single event handler instead of three different ones:
386
-
>>>>>>> 1697ae89a3bbafd76998dd7496754e5358bc1e9a
387
383
388
384
<Sandpack>
389
385
@@ -583,8 +579,8 @@ export default function Form() {
583
579
<br />
584
580
(located in {person.artwork.city})
585
581
</p>
586
-
<img
587
-
src={person.artwork.image}
582
+
<img
583
+
src={person.artwork.image}
588
584
alt={person.artwork.title}
589
585
/>
590
586
</>
@@ -654,7 +650,7 @@ let obj3 = {
654
650
655
651
Se dovessi mutare `obj3.artwork.city`, questo impatterebbe sia `obj2.artwork.city` che `obj1.city`. Questo perché `obj3.artwork`, `obj2.artwork` e `obj1` sono lo stesso oggetto. Questo è difficile da capire quando pensi agli oggetti come "nidificati". Invece, sono oggetti separati che si "puntano" a vicenda tramite le proprietà.
656
652
657
-
</DeepDive>
653
+
</DeepDive>
658
654
659
655
### Scrivi logica di aggiornamento concisa con Immer {/*write-concise-update-logic-with-immer*/}
660
656
@@ -759,8 +755,8 @@ export default function Form() {
0 commit comments