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/installation.md
+11-39Lines changed: 11 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,7 @@ React è stato progettato sin dal principio per essere adottato gradualmente. A
8
8
9
9
</Intro>
10
10
11
-
<<<<<<< HEAD
12
-
<YouWillLearnisChapter={true}>
13
-
14
-
*[Come avviare un nuovo progetto React](/learn/start-a-new-react-project)
15
-
*[Come aggiungere React ad un progetto esistente](/learn/add-react-to-an-existing-project)
16
-
*[Come configurare il tuo editor](/learn/editor-setup)
17
-
*[Come installare i React Developer Tools](/learn/react-developer-tools)
18
-
19
-
</YouWillLearn>
20
-
21
11
## Prova React {/*try-react*/}
22
-
=======
23
-
## Try React {/*try-react*/}
24
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
25
12
26
13
Non devi installare nulla se vuoi divertirti con React. Prova a modificare questa sandbox!
27
14
@@ -43,43 +30,28 @@ Puoi modificarla direttamente o aprirla in un nuovo tab premendo il bottone "For
43
30
44
31
La maggioranza delle pagine della documentazione di React contengono sandboxes come questa. Al di fuori della documentazione, esistono alcune sandboxes online che supportano React: ad esempio, [CodeSandbox](https://codesandbox.io/s/new), [StackBlitz](https://stackblitz.com/fork/react), o [CodePen.](https://codepen.io/pen?template=QWYVwWN)
Per provare React localmente sul tuo computer, [scarica questa pagina HTML.](https://gist.githubusercontent.com/gaearon/0275b1e1518599bbeafcde4722e79ed1/raw/db72dcbf3384ee1708c4a07d3be79860db04bff0/example.html) Aprila nel tuo editor e nel tuo browser!
48
34
49
-
Per provare React localmente sul suo computer, [scarica questa pagina HTML.](https://gist.githubusercontent.com/gaearon/0275b1e1518599bbeafcde4722e79ed1/raw/db72dcbf3384ee1708c4a07d3be79860db04bff0/example.html) Aprila nel tuo editor e nel tuo browser!
35
+
## Creare un'App React {/*creating-a-react-app*/}
50
36
51
-
## Inizia un nuovo progetto React {/*start-a-new-react-project*/}
52
-
53
-
Se desideri creare un'app o un sito web completamente con React, [inizia un nuovo progetto React.](/learn/start-a-new-react-project)
54
-
55
-
## Aggiungi React ad un progetto esistente {/*add-react-to-an-existing-project*/}
56
-
=======
57
-
To try React locally on your computer, [download this HTML page.](https://gist.githubusercontent.com/gaearon/0275b1e1518599bbeafcde4722e79ed1/raw/db72dcbf3384ee1708c4a07d3be79860db04bff0/example.html) Open it in your editor and in your browser!
37
+
Se vuoi iniziare una nuova app React, puoi [creare un'app React](/learn/creating-a-react-app) utilizzando un framework consigliato.
58
38
59
-
## Creating a React App {/*creating-a-react-app*/}
39
+
## Costruire un'App React da zero {/*build-a-react-app-from-scratch*/}
60
40
61
-
If you want to start a new React app, you can [create a React app](/learn/creating-a-react-app) using a recommended framework.
41
+
Se un framework non è adatto al tuo progetto, preferisci costruire il tuo framework, o vuoi semplicemente imparare le basi di un'app React puoi [costruire un'app React da zero](/learn/build-a-react-app-from-scratch).
62
42
63
-
## Build a React App from Scratch {/*build-a-react-app-from-scratch*/}
64
-
65
-
If a framework is not a good fit for your project, you prefer to build your own framework, or you just want to learn the basics of a React app you can [build a React app from scratch](/learn/build-a-react-app-from-scratch).
66
-
67
-
## Add React to an existing project {/*add-react-to-an-existing-project*/}
68
-
69
-
If want to try using React in your existing app or a website, you can [add React to an existing project.](/learn/add-react-to-an-existing-project)
43
+
## Aggiungi React ad un progetto esistente {/*add-react-to-an-existing-project*/}
70
44
45
+
Se vuoi provare ad utilizzare React nella tua app esistente o in un sito web, puoi [aggiungere React a un progetto esistente.](/learn/add-react-to-an-existing-project)
71
46
72
47
<Note>
73
48
74
-
#### Should I use Create React App? {/*should-i-use-create-react-app*/}
No. Create React App has been deprecated. For more information, see [Sunsetting Create React App](/blog/2025/02/14/sunsetting-create-react-app).
51
+
No. Create React App è stato deprecato. Per maggiori informazioni, consulta [Il sunsetting di Create React App](/blog/2025/02/14/sunsetting-create-react-app).
77
52
78
53
</Note>
79
54
80
-
## Next steps {/*next-steps*/}
81
-
82
-
Head to the [Quick Start](/learn) guide for a tour of the most important React concepts you will encounter every day.
83
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
55
+
## Prossimi passi {/*next-steps*/}
84
56
85
-
Se desideri provare ad utilizzare React nella tua app o in un sito web esistente, [aggiungi React ad un progetto esistente.](/learn/add-react-to-an-existing-project)
57
+
Vai alla guida [Quick Start](/learn) per un tour dei più importanti concetti di React che incontrerai ogni giorno.
Copy file name to clipboardExpand all lines: src/content/learn/passing-data-deeply-with-context.md
+20-45Lines changed: 20 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -476,11 +476,7 @@ export default function Section({ level, children }) {
476
476
}
477
477
```
478
478
479
-
<<<<<<< HEAD
480
-
Questo dice a React: "se un qualsiasi componente all'interno di questa `<Section>` richiede `LevelContext`, fornisci loro questo `level`." Il componente utilizzerà il valore del `<LevelContext.Provider>` più vicino nell'albero della UI sopra di esso.
481
-
=======
482
-
This tells React: "if any component inside this `<Section>` asks for `LevelContext`, give them this `level`." The component will use the value of the nearest `<LevelContext>` in the UI tree above it.
483
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
479
+
Questo dice a React: "se un qualsiasi componente all'interno di questa `<Section>` richiede `LevelContext`, fornisci loro questo `level`." Il componente utilizzerà il valore del `<LevelContext>` più vicino nell'albero della UI sopra di esso.
È lo stesso risultato del codice originale, ma non hai dovuto passare la prop `level` a ciascun componente `Heading`! Invece, questo "capisce" il suo livello d'intestazione interrogando il `Section` più vicino sopra di esso:
572
568
573
-
<<<<<<< HEAD
574
569
1. Passi la prop `level` a `<Section>`.
575
-
2.`Section` avvolge i suoi figli in `<LevelContext.Provider value={level}>`.
570
+
2.`Section` avvolge i suoi figli in `<LevelContext value={level}>`.
576
571
3.`Heading` richiede il valore più vicino di `LevelContext` sopra di sé con `useContext(LevelContext)`.
577
-
=======
578
-
1. You pass a `level` prop to the `<Section>`.
579
-
2.`Section` wraps its children into `<LevelContext value={level}>`.
580
-
3.`Heading` asks the closest value of `LevelContext` above with `useContext(LevelContext)`.
581
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
582
572
583
573
## Usare e fornire un context dallo stesso componente {/*using-and-providing-context-from-the-same-component*/}
584
574
@@ -874,25 +864,14 @@ In generale, se alcune informazioni sono necessarie da componenti distanti in di
874
864
875
865
<Recap>
876
866
877
-
<<<<<<< HEAD
878
867
* Il context consente a un componente di fornire alcune informazioni a tutto l'albero sottostante:
879
868
* Per passare il context:
880
869
1. Crealo ed esportalo con `exportconstMyContext=createContext(defaultValue)`.
881
870
2. Passalo all'Hook `useContext(MyContext)` per leggerlo in qualsiasi componente figlio, indipendentemente da quando in profondità sia.
882
-
3. Avvolgi i figli in `<MyContext.Provider value={...}>` per fornirlo da un genitore.
871
+
3. Avvolgi i figli in `<MyContext value={...}>` per fornirlo da un genitore.
883
872
* Il context attraversa qualsiasi componente intermedio.
884
873
* Il context ti consente di scrivere componenti che "si adattano all'ambiente circostante".
885
874
* Prima di utilizzare il context, prova a passare le props o passare il JSX come `children`.
886
-
=======
887
-
* Context lets a component provide some information to the entire tree below it.
888
-
* To pass context:
889
-
1. Create and export it with `exportconstMyContext=createContext(defaultValue)`.
890
-
2. Pass it to the `useContext(MyContext)` Hook to read it in any child component, no matter how deep.
891
-
3. Wrap children into `<MyContext value={...}>` to provide it from a parent.
892
-
* Context passes through any components in the middle.
893
-
* Context lets you write components that "adapt to their surroundings".
894
-
* Before you use context, try passing props or passing JSX as `children`.
895
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
896
875
897
876
</Recap>
898
877
@@ -984,27 +963,27 @@ export const places = [{
984
963
description:'The tradition of choosing bright colors for houses began in the late 20th century.',
985
964
imageId:'K9HVAGH'
986
965
}, {
987
-
id:1,
966
+
id:1,
988
967
name:'Rainbow Village in Taichung, Taiwan',
989
968
description:'To save the houses from demolition, Huang Yung-Fu, a local resident, painted all 1,200 of them in 1924.',
990
969
imageId:'9EAYZrt'
991
970
}, {
992
-
id:2,
971
+
id:2,
993
972
name:'Macromural de Pachuca, Mexico',
994
973
description:'One of the largest murals in the world covering homes in a hillside neighborhood.',
995
974
imageId:'DgXHVwu'
996
975
}, {
997
-
id:3,
976
+
id:3,
998
977
name:'Selarón Staircase in Rio de Janeiro, Brazil',
999
978
description:'This landmark was created by Jorge Selarón, a Chilean-born artist, as a "tribute to the Brazilian people."',
1000
979
imageId:'aeO3rpI'
1001
980
}, {
1002
-
id:4,
981
+
id:4,
1003
982
name:'Burano, Italy',
1004
983
description:'The houses are painted following a specific color system dating back to 16th century.',
1005
984
imageId:'kxsph5C'
1006
985
}, {
1007
-
id:5,
986
+
id:5,
1008
987
name:'Chefchaouen, Marocco',
1009
988
description:'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.',
1010
989
imageId:'rTqKo46'
@@ -1028,9 +1007,9 @@ export function getImageUrl(place) {
1028
1007
1029
1008
```css
1030
1009
ul { list-style-type: none; padding:0px10px; }
1031
-
li {
1032
-
margin-bottom:10px;
1033
-
display: grid;
1010
+
li {
1011
+
margin-bottom:10px;
1012
+
display: grid;
1034
1013
grid-template-columns: auto 1fr;
1035
1014
gap:20px;
1036
1015
align-items: center;
@@ -1043,11 +1022,7 @@ li {
1043
1022
1044
1023
Rimuovi la prop `imageSize` da tutti i componenti.
1045
1024
1046
-
<<<<<<< HEAD
1047
-
Crea ed esporta `ImageSizeContext` da `Context.js`. Quindi avvolgi `List` in `<ImageSizeContext.Provider value={imageSize}>` per passare il valore in basso, e utilizza `useContext(ImageSizeContext)` per leggerlo in `PlaceImage`:
1048
-
=======
1049
-
Create and export `ImageSizeContext` from `Context.js`. Then wrap the List into `<ImageSizeContext value={imageSize}>` to pass the value down, and `useContext(ImageSizeContext)` to read it in the `PlaceImage`:
1050
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
1025
+
Crea ed esporta `ImageSizeContext` da `Context.js`. Quindi avvolgi `List` in `<ImageSizeContext value={imageSize}>` per passare il valore in basso, e utilizza `useContext(ImageSizeContext)` per leggerlo in `PlaceImage`:
1051
1026
1052
1027
<Sandpack>
1053
1028
@@ -1127,27 +1102,27 @@ export const places = [{
1127
1102
description:'The tradition of choosing bright colors for houses began in the late 20th century.',
1128
1103
imageId:'K9HVAGH'
1129
1104
}, {
1130
-
id:1,
1105
+
id:1,
1131
1106
name:'Rainbow Village in Taichung, Taiwan',
1132
1107
description:'To save the houses from demolition, Huang Yung-Fu, a local resident, painted all 1,200 of them in 1924.',
1133
1108
imageId:'9EAYZrt'
1134
1109
}, {
1135
-
id:2,
1110
+
id:2,
1136
1111
name:'Macromural de Pachuca, Mexico',
1137
1112
description:'One of the largest murals in the world covering homes in a hillside neighborhood.',
1138
1113
imageId:'DgXHVwu'
1139
1114
}, {
1140
-
id:3,
1115
+
id:3,
1141
1116
name:'Selarón Staircase in Rio de Janeiro, Brazil',
1142
1117
description:'This landmark was created by Jorge Selarón, a Chilean-born artist, as a "tribute to the Brazilian people".',
1143
1118
imageId:'aeO3rpI'
1144
1119
}, {
1145
-
id:4,
1120
+
id:4,
1146
1121
name:'Burano, Italy',
1147
1122
description:'The houses are painted following a specific color system dating back to 16th century.',
1148
1123
imageId:'kxsph5C'
1149
1124
}, {
1150
-
id:5,
1125
+
id:5,
1151
1126
name:'Chefchaouen, Marocco',
1152
1127
description:'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.',
1153
1128
imageId:'rTqKo46'
@@ -1171,9 +1146,9 @@ export function getImageUrl(place) {
Copy file name to clipboardExpand all lines: src/content/learn/render-and-commit.md
+3-14Lines changed: 3 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ export default function Image() {
65
65
66
66
Prova a commentare la chiamata `root.render()` e vedrai il componente scomparire!
67
67
68
-
### Renderizzare nuovamente quando lo state viene aggiornato{/*re-renders-when-state-updates*/}
68
+
### Renderizzare nuovamente quando lo state viene aggiornato{/*re-renders-when-state-updates*/}
69
69
70
70
Una volta che il componente è inizialmente renderizzato, è possibile avviare ulteriori renderizzazioni aggiornando il suo state con la [funzione `set`.](/reference/react/useState#setstate) Aggiornare lo state del componente mette automaticamente in coda una renderizzazione (puoi immaginarlo come un ospite del ristorante che ordina tè, dessert e ogni sorta di cosa dopo aver effettuato il primo ordine, a seconda della sua sete o fame)
71
71
@@ -84,11 +84,7 @@ Dopo aver avviato la renderizzazione, React richiama i tuoi componenti per capir
84
84
85
85
Questo processo è ricorsivo: se il componente aggiornato restituisce un altro componente, React renderizzerà _quel_ componente successivamente, e se quel componente restituisce a sua volta qualcosa, renderizzerà _quel_ componente successivamente, e cosi via. Il processo continua finché non ci sono più componenti annidati e React sa esattamente cosa mostrare a schermo.
86
86
87
-
<<<<<<< HEAD
88
-
Nell'esempio seguente, React chiamerà `Gallery()` e `Image()` diverse volte:
89
-
=======
90
-
In the following example, React will call `Gallery()` and `Image()` several times:
91
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
87
+
Nell'esempio seguente, React chiamerà `Gallery()` e `Image()` diverse volte:
***Durante la renderizzazione iniziale,** React [creerà i nodi del DOM](https://developer.mozilla.org/docs/Web/API/Document/createElement) per `<section>`, `<h1>`, e tre tag `<img>`.
127
+
***Durante la renderizzazione iniziale,** React [creerà i nodi del DOM](https://developer.mozilla.org/docs/Web/API/Document/createElement) per `<section>`, `<h1>`, e tre tag `<img>`.
132
128
***Durante una renderizzazione successiva,** React calcolerà quali delle sue proprietà, se presenti, sono cambiate rispetto la renderizzazione precedente. Tuttavia, non farà nulla con queste informazioni fino alla prossima fase, la fase di commit.
133
129
134
130
<Pitfall>
@@ -152,17 +148,10 @@ Il comportamento predefinito di renderizzare tutti i componenti annidati all'int
152
148
153
149
## Step 3: React aggiorna il DOM {/*step-3-react-commits-changes-to-the-dom*/}
154
150
155
-
<<<<<<< HEAD
156
151
Dopo aver renderizzato (chiamato) i componenti, React aggiornerà il DOM.
157
152
158
153
***Per la renderizzazione iniziale,** React utilizzerà l'API DOM [`appendChild()`](https://developer.mozilla.org/docs/Web/API/Node/appendChild) per inserire tutti i nodi DOM creati sullo schermo.
159
154
***Per ri-renderizzare,** React applicherà solo le operazioni minime necessarie (calcolate durante il rendering!) per rendere il DOM uguale all'ultimo output di rendering.
160
-
=======
161
-
After rendering (calling) your components, React will modify the DOM.
162
-
163
-
***For the initial render,** React will use the [`appendChild()`](https://developer.mozilla.org/docs/Web/API/Node/appendChild) DOM API to put all the DOM nodes it has created on screen.
164
-
***For re-renders,** React will apply the minimal necessary operations (calculated while rendering!) to make the DOM match the latest rendering output.
165
-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
166
155
167
156
**React cambia solo i nodi DOM se c'è una differenza tra le renderizzazioni.** Ad esempio, ecco un componente che si ri-renderizza con diverse props passate dal suo genitore ogni secondo. Notare come è possibile aggiungere del testo nell' `<input>` aggiornando il suo `value`, ma il testo non scompare quando il componente si ri-renderizza:
0 commit comments