Skip to content

Commit b37b037

Browse files
committed
chore: merge conflicts
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
1 parent 897b11e commit b37b037

File tree

7 files changed

+71
-290
lines changed

7 files changed

+71
-290
lines changed

src/content/learn/installation.md

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@ React è stato progettato sin dal principio per essere adottato gradualmente. A
88

99
</Intro>
1010

11-
<<<<<<< HEAD
12-
<YouWillLearn isChapter={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-
2111
## Prova React {/*try-react*/}
22-
=======
23-
## Try React {/*try-react*/}
24-
>>>>>>> f6d762cbbf958ca45bb8d1d011b31e5289e43a3d
2512

2613
Non devi installare nulla se vuoi divertirti con React. Prova a modificare questa sandbox!
2714

@@ -43,43 +30,28 @@ Puoi modificarla direttamente o aprirla in un nuovo tab premendo il bottone "For
4330

4431
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)
4532

46-
<<<<<<< HEAD
47-
### Prova React localmente {/*try-react-locally*/}
33+
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!
4834

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*/}
5036

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

59-
## Creating a React App {/*creating-a-react-app*/}
39+
## Costruire un'App React da zero {/*build-a-react-app-from-scratch*/}
6040

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).
6242

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*/}
7044

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)
7146

7247
<Note>
7348

74-
#### Should I use Create React App? {/*should-i-use-create-react-app*/}
49+
#### Dovrei usare Create React App? {/*should-i-use-create-react-app*/}
7550

76-
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).
7752

7853
</Note>
7954

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*/}
8456

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.

src/content/learn/passing-data-deeply-with-context.md

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,7 @@ export default function Section({ level, children }) {
476476
}
477477
```
478478

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

485481
<Sandpack>
486482

@@ -570,15 +566,9 @@ export const LevelContext = createContext(1);
570566

571567
È 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:
572568

573-
<<<<<<< HEAD
574569
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}>`.
576571
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
582572

583573
## Usare e fornire un context dallo stesso componente {/*using-and-providing-context-from-the-same-component*/}
584574

@@ -874,25 +864,14 @@ In generale, se alcune informazioni sono necessarie da componenti distanti in di
874864
875865
<Recap>
876866
877-
<<<<<<< HEAD
878867
* Il context consente a un componente di fornire alcune informazioni a tutto l'albero sottostante:
879868
* Per passare il context:
880869
1. Crealo ed esportalo con `export const MyContext = createContext(defaultValue)`.
881870
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.
883872
* Il context attraversa qualsiasi componente intermedio.
884873
* Il context ti consente di scrivere componenti che "si adattano all'ambiente circostante".
885874
* 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 `export const MyContext = 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
896875
897876
</Recap>
898877
@@ -984,27 +963,27 @@ export const places = [{
984963
description: 'The tradition of choosing bright colors for houses began in the late 20th century.',
985964
imageId: 'K9HVAGH'
986965
}, {
987-
id: 1,
966+
id: 1,
988967
name: 'Rainbow Village in Taichung, Taiwan',
989968
description: 'To save the houses from demolition, Huang Yung-Fu, a local resident, painted all 1,200 of them in 1924.',
990969
imageId: '9EAYZrt'
991970
}, {
992-
id: 2,
971+
id: 2,
993972
name: 'Macromural de Pachuca, Mexico',
994973
description: 'One of the largest murals in the world covering homes in a hillside neighborhood.',
995974
imageId: 'DgXHVwu'
996975
}, {
997-
id: 3,
976+
id: 3,
998977
name: 'Selarón Staircase in Rio de Janeiro, Brazil',
999978
description: 'This landmark was created by Jorge Selarón, a Chilean-born artist, as a "tribute to the Brazilian people."',
1000979
imageId: 'aeO3rpI'
1001980
}, {
1002-
id: 4,
981+
id: 4,
1003982
name: 'Burano, Italy',
1004983
description: 'The houses are painted following a specific color system dating back to 16th century.',
1005984
imageId: 'kxsph5C'
1006985
}, {
1007-
id: 5,
986+
id: 5,
1008987
name: 'Chefchaouen, Marocco',
1009988
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.',
1010989
imageId: 'rTqKo46'
@@ -1028,9 +1007,9 @@ export function getImageUrl(place) {
10281007
10291008
```css
10301009
ul { list-style-type: none; padding: 0px 10px; }
1031-
li {
1032-
margin-bottom: 10px;
1033-
display: grid;
1010+
li {
1011+
margin-bottom: 10px;
1012+
display: grid;
10341013
grid-template-columns: auto 1fr;
10351014
gap: 20px;
10361015
align-items: center;
@@ -1043,11 +1022,7 @@ li {
10431022
10441023
Rimuovi la prop `imageSize` da tutti i componenti.
10451024
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`:
10511026
10521027
<Sandpack>
10531028
@@ -1127,27 +1102,27 @@ export const places = [{
11271102
description: 'The tradition of choosing bright colors for houses began in the late 20th century.',
11281103
imageId: 'K9HVAGH'
11291104
}, {
1130-
id: 1,
1105+
id: 1,
11311106
name: 'Rainbow Village in Taichung, Taiwan',
11321107
description: 'To save the houses from demolition, Huang Yung-Fu, a local resident, painted all 1,200 of them in 1924.',
11331108
imageId: '9EAYZrt'
11341109
}, {
1135-
id: 2,
1110+
id: 2,
11361111
name: 'Macromural de Pachuca, Mexico',
11371112
description: 'One of the largest murals in the world covering homes in a hillside neighborhood.',
11381113
imageId: 'DgXHVwu'
11391114
}, {
1140-
id: 3,
1115+
id: 3,
11411116
name: 'Selarón Staircase in Rio de Janeiro, Brazil',
11421117
description: 'This landmark was created by Jorge Selarón, a Chilean-born artist, as a "tribute to the Brazilian people".',
11431118
imageId: 'aeO3rpI'
11441119
}, {
1145-
id: 4,
1120+
id: 4,
11461121
name: 'Burano, Italy',
11471122
description: 'The houses are painted following a specific color system dating back to 16th century.',
11481123
imageId: 'kxsph5C'
11491124
}, {
1150-
id: 5,
1125+
id: 5,
11511126
name: 'Chefchaouen, Marocco',
11521127
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.',
11531128
imageId: 'rTqKo46'
@@ -1171,9 +1146,9 @@ export function getImageUrl(place) {
11711146
11721147
```css
11731148
ul { list-style-type: none; padding: 0px 10px; }
1174-
li {
1175-
margin-bottom: 10px;
1176-
display: grid;
1149+
li {
1150+
margin-bottom: 10px;
1151+
display: grid;
11771152
grid-template-columns: auto 1fr;
11781153
gap: 20px;
11791154
align-items: center;

src/content/learn/render-and-commit.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Image() {
6565

6666
Prova a commentare la chiamata `root.render()` e vedrai il componente scomparire!
6767

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*/}
6969

7070
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)
7171

@@ -84,11 +84,7 @@ Dopo aver avviato la renderizzazione, React richiama i tuoi componenti per capir
8484

8585
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.
8686

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:
9288

9389
<Sandpack>
9490

@@ -128,7 +124,7 @@ img { margin: 0 10px 10px 0; }
128124

129125
</Sandpack>
130126

131-
* **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>`.
132128
* **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.
133129

134130
<Pitfall>
@@ -152,17 +148,10 @@ Il comportamento predefinito di renderizzare tutti i componenti annidati all'int
152148

153149
## Step 3: React aggiorna il DOM {/*step-3-react-commits-changes-to-the-dom*/}
154150

155-
<<<<<<< HEAD
156151
Dopo aver renderizzato (chiamato) i componenti, React aggiornerà il DOM.
157152

158153
* **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.
159154
* **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
166155

167156
**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:
168157

0 commit comments

Comments
 (0)