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/add-react-to-an-existing-project.md
+2-12Lines changed: 2 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,9 @@ Supponiamo tu abbia una web app esistente a `example.com` costruita con un'altra
20
20
21
21
Ecco come ti consigliamo di impostarla:
22
22
23
-
<<<<<<< HEAD
24
-
1.**Crea la parte React della tua app** utilizzando uno dei [framework basati su React](/learn/start-a-new-react-project).
23
+
1.**Crea la parte React della tua app** utilizzando uno dei [framework basati su React](/learn/creating-a-react-app).
25
24
2.**Specifica `/some-app` come *percorso di base*** nella configurazione del tuo framework (ecco come: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
26
25
3.**Configura il tuo server o un proxy** in modo che tutte le richieste in `/some-app/` siano gestite dalla tua app React.
27
-
=======
28
-
1.**Build the React part of your app** using one of the [React-based frameworks](/learn/creating-a-react-app).
29
-
2.**Specify `/some-app` as the *base path*** in your framework's configuration (here's how: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
30
-
3.**Configure your server or a proxy** so that all requests under `/some-app/` are handled by your React app.
31
-
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
32
26
33
27
Ciò garantisce che la parte React della tua app possa [trarre vantaggio dalle best practices](/learn/build-a-react-app-from-scratch#consider-using-a-framework) integrate in tali framework.
Nota come il contenuto HTML originale di `index.html` sia stato preservato, ma il tuo componente React `NavigationBar` ora appare all'interno del `<nav id="navigation">` del tuo HTML. Leggi la documentazione sull'[uso di `createRoot`](/reference/react-dom/client/createRoot#rendering-a-page-partially-built-with-react) per saperne di più sul rendering di componenti React all'interno di una pagina HTML esistente.
157
151
158
-
<<<<<<< HEAD
159
-
Quando adotti React in un progetto esistente, è comune iniziare con piccoli componenti interattivi (come i pulsanti), e poi gradualmente continuare a "salire" fino a quando alla fine l'intera pagina è costruita con React. Se raggiungi mai quel punto, ti consigliamo di migrare verso [un framework React](/learn/start-a-new-react-project) subito dopo per ottenere il massimo da React.
160
-
=======
161
-
When you adopt React in an existing project, it's common to start with small interactive components (like buttons), and then gradually keep "moving upwards" until eventually your entire page is built with React. If you ever reach that point, we recommend migrating to [a React framework](/learn/creating-a-react-app) right after to get the most out of React.
162
-
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
152
+
Quando adotti React in un progetto esistente, è comune iniziare con piccoli componenti interattivi (come i pulsanti), e poi gradualmente continuare a "salire" fino a quando alla fine l'intera pagina è costruita con React. Se raggiungi mai quel punto, ti consigliamo di migrare verso [un framework React](/learn/creating-a-react-app) subito dopo per ottenere il massimo da React.
163
153
164
154
## Utilizzare React Native in un'app mobile nativa esistente {/*using-react-native-in-an-existing-native-mobile-app*/}
Copy file name to clipboardExpand all lines: src/content/learn/thinking-in-react.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,15 +37,9 @@ Inizia disegnando rettangoli intorno a ogni componente e sottocomponente nel moc
37
37
38
38
A seconda del tuo background, puoi pensare di dividere un design in componenti in diversi modi:
39
39
40
-
<<<<<<< HEAD
41
-
***Programming**--usa lo stesso metodo per decidere se creare una nuova funzione o un nuovo oggetto. Uno di questi metodi è il [single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle), ovvero un componente dovrebbe fare solo una cosa. Se cresce, dovrebbe essere decomposto in sottocomponenti più piccoli.
40
+
***Programming**--usa lo stesso metodo per decidere se creare una nuova funzione o un nuovo oggetto. Uno di questi metodi è il [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns), ovvero un componente dovrebbe fare solo una cosa. Se cresce, dovrebbe essere decomposto in sottocomponenti più piccoli.
42
41
***CSS**--considera cosa farebbe un selettore di classe. (Tuttavia, i componenti sono un po' meno granulari.)
43
42
***Design**--considera come organizzare i livelli del design.
44
-
=======
45
-
***Programming**--use the same techniques for deciding if you should create a new function or object. One such technique is the [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns), that is, a component should ideally only be concerned with one thing. If it ends up growing, it should be decomposed into smaller subcomponents.
46
-
***CSS**--consider what you would make class selectors for. (However, components are a bit less granular.)
47
-
***Design**--consider how you would organize the design's layers.
48
-
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
49
43
50
44
Se il tuo JSON è strutturato bene, noterai che spesso mappa naturalmente la struttura dei componenti della tua UI. Questo perché la UI e i modelli di dati spesso hanno la stessa architettura dell'informazione--ovvero la stessa forma. Separa la tua UI in componenti, in cui ogni componente corrisponde a una parte del tuo modello di dati.
Copy file name to clipboardExpand all lines: src/content/learn/your-first-component.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,11 +215,7 @@ La tua applicazione React inizia con un componente "radice" (_root_). Di solito,
215
215
216
216
La maggior parte delle applicazioni React utilizza i componenti fino in fondo. Ciò significa che non userai i componenti solo per piccole parti riutilizzabili come i pulsanti, ma anche per parti più grandi come barre laterali, elenchi e, infine, pagine complete! I componenti sono un modo pratico per organizzare il codice e il markup dell'interfaccia utente, anche se alcuni di essi dovessero essere utilizzati una sola volta.
217
217
218
-
<<<<<<< HEAD
219
-
I [framework basati su React](/learn/start-a-new-react-project) compiono un ulteriore passo avanti. Invece di usare un file HTML vuoto e lasciare che React si occupi di gestire la pagina con JavaScript, generano automaticamente l'HTML dai componenti React. Questo permette all'applicazione di mostrare alcuni contenuti prima del caricamento del codice JavaScript.
220
-
=======
221
-
[React-based frameworks](/learn/creating-a-react-app) take this a step further. Instead of using an empty HTML file and letting React "take over" managing the page with JavaScript, they *also* generate the HTML automatically from your React components. This allows your app to show some content before the JavaScript code loads.
222
-
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
218
+
I [framework basati su React](/learn/creating-a-react-app) compiono un ulteriore passo avanti. Invece di usare un file HTML vuoto e lasciare che React si occupi di gestire la pagina con JavaScript, generano automaticamente l'HTML dai componenti React. Questo permette all'applicazione di mostrare alcuni contenuti prima del caricamento del codice JavaScript.
223
219
224
220
Tuttavia, molti siti web usano React solo per [aggiungere interattività a pagine HTML esistenti.](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page) Hanno molti componenti radice invece di uno singolo per l'intera pagina. È possibile utilizzare tanto o poco React in base alle tue esigenze.
React-dom contiene funzionalità supportate solo per le applicazioni web (che vengono eseguite nell'ambiente DOM del browser). Questa sezione è suddivisa come segue:
24
+
React DOM contiene funzionalità supportate solo per le applicazioni web (che vengono eseguite nell'ambiente DOM del browser). Questa sezione è suddivisa come segue:
26
25
27
26
*[Hooks](/reference/react-dom/hooks) - Hooks per le applicazioni web che vengono eseguite nell'ambiente DOM del browser.
28
27
*[Componenti](/reference/react-dom/components) - React supporta tutti i componenti HTML e SVG integrati nel browser.
29
28
*[API](/reference/react-dom) - Il pacchetto `react-dom` contiene metodi supportati solo nelle applicazioni web.
30
29
*[API del client](/reference/react-dom/client) - Le API `react-dom/client` ti consentono di renderizzare i componenti React sul client (nel browser).
31
30
*[API del server](/reference/react-dom/server) - Le API `react-dom/server` ti consentono di renderizzare i componenti React in HTML sul server.
32
-
=======
33
-
React DOM contains features that are only supported for web applications (which run in the browser DOM environment). This section is broken into the following:
34
-
35
-
*[Hooks](/reference/react-dom/hooks) - Hooks for web applications which run in the browser DOM environment.
36
-
*[Components](/reference/react-dom/components) - React supports all of the browser built-in HTML and SVG components.
37
-
*[APIs](/reference/react-dom) - The `react-dom` package contains methods supported only in web applications.
38
-
*[Client APIs](/reference/react-dom/client) - The `react-dom/client` APIs let you render React components on the client (in the browser).
39
-
*[Server APIs](/reference/react-dom/server) - The `react-dom/server` APIs let you render React components to HTML on the server.
40
-
*[Static APIs](/reference/react-dom/static) - The `react-dom/static` APIs let you generate static HTML for React components.
41
-
>>>>>>> 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
31
+
*[API statici](/reference/react-dom/static) - Le API `react-dom/static` ti consentono di generare HTML statico per i componenti React.
0 commit comments