Skip to content

Commit c258a3a

Browse files
Ago95DevTh3Walldeblasis
authored
Translated Describing the UI (#427)
* Traduzione iniziale "Describing the UI" Tradotto fino a rendering condizionale. Da revisionare * Traduzione "describing the ui" e sidebar relativa * Update intestazioni describing-the-ui.md * Update describing-the-ui.md * Update src/sidebarLearn.json Co-authored-by: Davide Mandelli <[email protected]> * Update title describing-the-ui.md * chore: titles casing * chore: nit --------- Co-authored-by: Davide Mandelli <[email protected]> Co-authored-by: Alessandro De Blasis <[email protected]>
1 parent dccf591 commit c258a3a

File tree

2 files changed

+46
-47
lines changed

2 files changed

+46
-47
lines changed

Diff for: src/content/learn/describing-the-ui.md

+45-46
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
2-
title: Describing the UI
2+
title: Descrivere la UI
33
---
44

55
<Intro>
66

7-
React is a JavaScript library for rendering user interfaces (UI). UI is built from small units like buttons, text, and images. React lets you combine them into reusable, nestable *components.* From web sites to phone apps, everything on the screen can be broken down into components. In this chapter, you'll learn to create, customize, and conditionally display React components.
7+
React è una libreria JavaScript per il rendering delle interfacce utente(UI). La UI è costruita da piccole unità come pulsanti, testo e immagini. React ti consente di combinare queste unità in *componenti* riutilizzabili e annidabili. Dalle pagine web alle app per telefoni, tutto sullo schermo può essere scomposto in componenti. In questo capitolo imparerai a creare, personalizzare e visualizzare condizionalmente i componenti React.
88

99
</Intro>
1010

1111
<YouWillLearn isChapter={true}>
1212

13-
* [How to write your first React component](/learn/your-first-component)
14-
* [When and how to create multi-component files](/learn/importing-and-exporting-components)
15-
* [How to add markup to JavaScript with JSX](/learn/writing-markup-with-jsx)
16-
* [How to use curly braces with JSX to access JavaScript functionality from your components](/learn/javascript-in-jsx-with-curly-braces)
17-
* [How to configure components with props](/learn/passing-props-to-a-component)
18-
* [How to conditionally render components](/learn/conditional-rendering)
19-
* [How to render multiple components at a time](/learn/rendering-lists)
20-
* [How to avoid confusing bugs by keeping components pure](/learn/keeping-components-pure)
13+
* [Come scrivere il tuo primo componente React](/learn/your-first-component)
14+
* [Quando e come creare file multi-componente](/learn/importing-and-exporting-components)
15+
* [Come aggiungere markup a JavaScript con JSX](/learn/writing-markup-with-jsx)
16+
* [Come utilizzare le parentesi graffe con JSX per accedere alla funzionalità JavaScript dai tuoi componenti](/learn/javascript-in-jsx-with-curly-braces)
17+
* [Come configurare i componenti con props](/learn/passing-props-to-a-component)
18+
* [Come rappresentare condizionalmente i componenti](/learn/conditional-rendering)
19+
* [Come renderizzare più componenti contemporaneamente](/learn/rendering-lists)
20+
* [Come evitare bug confusionari mantenendo i componenti puri](/learn/keeping-components-pure)
2121

2222
</YouWillLearn>
2323

24-
## Your first component {/*your-first-component*/}
24+
## Il tuo Primo Componente {/*your-first-component*/}
2525

26-
React applications are built from isolated pieces of UI called *components*. A React component is a JavaScript function that you can sprinkle with markup. Components can be as small as a button, or as large as an entire page. Here is a `Gallery` component rendering three `Profile` components:
26+
Le applicazioni React sono costruite da pezzi isolati di UI chiamati *componenti*. Un componente React è una funzione JavaScript che puoi arricchire con marcatura. I componenti possono essere piccoli come un pulsante o grandi come un'intera pagina. Ecco un componente `Gallery` che renderizza tre componenti `Profile`:
2727

2828
<Sandpack>
2929

@@ -57,14 +57,13 @@ img { margin: 0 10px 10px 0; height: 90px; }
5757

5858
<LearnMore path="/learn/your-first-component">
5959

60-
Read **[Your First Component](/learn/your-first-component)** to learn how to declare and use React components.
60+
Leggi **[Il Tuo Primo Componente](/learn/your-first-component)** per imparare a dichiarare e utilizzare i componenti React.
6161

6262
</LearnMore>
6363

64-
## Importing and exporting components {/*importing-and-exporting-components*/}
65-
66-
You can declare many components in one file, but large files can get difficult to navigate. To solve this, you can *export* a component into its own file, and then *import* that component from another file:
64+
## Importazione ed Esportazione di Componenti {/*importing-and-exporting-components*/}
6765

66+
Puoi dichiarare molti componenti in un unico file, ma i file grandi possono diventare difficili da gestire. Per risolvere questo problema, puoi *esportare* un componente in un file separato e poi importare quel componente da un altro file:
6867

6968
<Sandpack>
7069

@@ -112,15 +111,15 @@ img { margin: 0 10px 10px 0; }
112111

113112
<LearnMore path="/learn/importing-and-exporting-components">
114113

115-
Read **[Importing and Exporting Components](/learn/importing-and-exporting-components)** to learn how to split components into their own files.
114+
Leggi **[Importazione ed Esportazione di Componenti](/learn/importing-and-exporting-components)** per imparare come suddividere i componenti in file separati.
116115

117116
</LearnMore>
118117

119-
## Writing markup with JSX {/*writing-markup-with-jsx*/}
118+
## Scrivere Markup con JSX {/*writing-markup-with-jsx*/}
120119

121-
Each React component is a JavaScript function that may contain some markup that React renders into the browser. React components use a syntax extension called JSX to represent that markup. JSX looks a lot like HTML, but it is a bit stricter and can display dynamic information.
120+
Ogni componente React è una funzione JavaScript che può contenere del markup che React renderizza nel browser. I componenti React utilizzano una estensione di sintassi chiamata JSX per rappresentare questo markup. JSX assomiglia molto all'HTML, ma è un po' più rigoroso e può mostrare informazioni dinamiche.
122121

123-
If we paste existing HTML markup into a React component, it won't always work:
122+
Se copiamo del markup HTML esistente in un componente React, non funzionerà sempre:
124123

125124
<Sandpack>
126125

@@ -149,7 +148,7 @@ img { height: 90px; }
149148
150149
</Sandpack>
151150
152-
If you have existing HTML like this, you can fix it using a [converter](https://transform.tools/html-to-jsx):
151+
Se hai HTML esistente come questo, puoi risolverlo usando un [convertitore](https://transform.tools/html-to-jsx):
153152
154153
<Sandpack>
155154
@@ -181,13 +180,13 @@ img { height: 90px; }
181180

182181
<LearnMore path="/learn/writing-markup-with-jsx">
183182

184-
Read **[Writing Markup with JSX](/learn/writing-markup-with-jsx)** to learn how to write valid JSX.
183+
Leggi **[Scrivere Markup con JSX](/learn/writing-markup-with-jsx)** per imparare come scrivere JSX valido.
185184

186185
</LearnMore>
187186

188-
## JavaScript in JSX with curly braces {/*javascript-in-jsx-with-curly-braces*/}
187+
## JavaScript in JSX con Parentesi Graffe {/*javascript-in-jsx-with-curly-braces*/}
189188

190-
JSX lets you write HTML-like markup inside a JavaScript file, keeping rendering logic and content in the same place. Sometimes you will want to add a little JavaScript logic or reference a dynamic property inside that markup. In this situation, you can use curly braces in your JSX to "open a window" to JavaScript:
189+
JSX ti consente di scrivere markup simile all'HTML all'interno di un file JavaScript, mantenendo la logica di rendering e il contenuto nello stesso luogo. A volte vorrai aggiungere un po' di logica JavaScript o fare riferimento a una proprietà dinamica all'interno di quel markup. In questa situazione, puoi usare le parentesi graffe nel tuo JSX per "aprire una finestra" su JavaScript:
191190

192191
<Sandpack>
193192

@@ -229,13 +228,13 @@ body > div > div { padding: 20px; }
229228
230229
<LearnMore path="/learn/javascript-in-jsx-with-curly-braces">
231230
232-
Read **[JavaScript in JSX with Curly Braces](/learn/javascript-in-jsx-with-curly-braces)** to learn how to access JavaScript data from JSX.
231+
Leggi **[JavaScript in JSX con Parentesi Graffe](/learn/javascript-in-jsx-with-curly-braces)** per imparare come accedere ai dati JavaScript da JSX.
233232
234233
</LearnMore>
235234
236-
## Passing props to a component {/*passing-props-to-a-component*/}
235+
## Passare Prop a un Componente {/*passing-props-to-a-component*/}
237236
238-
React components use *props* to communicate with each other. Every parent component can pass some information to its child components by giving them props. Props might remind you of HTML attributes, but you can pass any JavaScript value through them, including objects, arrays, functions, and even JSX!
237+
I componenti React usano *prop* per comunicare tra loro. Ogni componente padre può passare informazioni ai suoi componenti figlio dandogli delle props. Le props potrebbero farti pensare agli attributi HTML, ma puoi passare qualsiasi valore JavaScript attraverso di esse, inclusi oggetti, array, funzioni e persino JSX!
239238
240239
<Sandpack>
241240
@@ -310,15 +309,15 @@ export function getImageUrl(person, size = 's') {
310309

311310
<LearnMore path="/learn/passing-props-to-a-component">
312311

313-
Read **[Passing Props to a Component](/learn/passing-props-to-a-component)** to learn how to pass and read props.
312+
Leggi **[Passaggio di Props a un Componente](/learn/passing-props-to-a-component)** per imparare come passare e leggere props.
314313

315314
</LearnMore>
316315

317-
## Conditional rendering {/*conditional-rendering*/}
316+
## Rendering Condizionale {/*conditional-rendering*/}
318317

319-
Your components will often need to display different things depending on different conditions. In React, you can conditionally render JSX using JavaScript syntax like `if` statements, `&&`, and `? :` operators.
318+
I tuoi componenti spesso dovranno mostrare cose diverse a seconda di diverse condizioni. In React, puoi renderizzare JSX in modo condizionale utilizzando la sintassi JavaScript come gli operatori `if`, `&&` e `? :`.
320319

321-
In this example, the JavaScript `&&` operator is used to conditionally render a checkmark:
320+
In questo esempio, l'operatore `&&` di JavaScript viene utilizzato per renderizzare in modo condizionale un segno di spunta:
322321

323322
<Sandpack>
324323

@@ -358,15 +357,15 @@ export default function PackingList() {
358357
359358
<LearnMore path="/learn/conditional-rendering">
360359
361-
Read **[Conditional Rendering](/learn/conditional-rendering)** to learn the different ways to render content conditionally.
360+
Leggi **[Rendering Condizionale](/learn/conditional-rendering)** per imparare i diversi modi per renderizzare contenuti condizionalmente.
362361
363362
</LearnMore>
364363
365-
## Rendering lists {/*rendering-lists*/}
364+
## Rendering di Liste {/*rendering-lists*/}
366365
367-
You will often want to display multiple similar components from a collection of data. You can use JavaScript's `filter()` and `map()` with React to filter and transform your array of data into an array of components.
366+
Spesso si desidera visualizzare più componenti simili da una raccolta di dati. È possibile utilizzare i metodi `filter()` e `map()` di JavaScript con React per filtrare e trasformare l'array di dati in un array di componenti.
368367

369-
For each array item, you will need to specify a `key`. Usually, you will want to use an ID from the database as a `key`. Keys let React keep track of each item's place in the list even if the list changes.
368+
Per ogni elemento dell'array, è necessario specificare una `key`. Di solito, si vuole utilizzare un ID dal database come `key`. Le chiavi consentono a React di tenere traccia del posizionamento di ciascun elemento nella lista anche se la lista cambia.
370369
371370
<Sandpack>
372371
@@ -458,18 +457,18 @@ h2 { font-size: 20px; }
458457

459458
<LearnMore path="/learn/rendering-lists">
460459

461-
Read **[Rendering Lists](/learn/rendering-lists)** to learn how to render a list of components, and how to choose a key.
460+
Leggi **[Renderizzare Liste](/learn/rendering-lists)** per imparare come renderizzare una lista di componenti e come scegliere una chiave.
462461

463462
</LearnMore>
464463

465-
## Keeping components pure {/*keeping-components-pure*/}
464+
## Mantenere i Componenti Puri {/*keeping-components-pure*/}
466465

467-
Some JavaScript functions are *pure.* A pure function:
466+
Alcune funzioni JavaScript sono *pure.* Una funzione pura:
468467

469-
* **Minds its own business.** It does not change any objects or variables that existed before it was called.
470-
* **Same inputs, same output.** Given the same inputs, a pure function should always return the same result.
468+
* **Si cura solo dei suoi affari.** Non modifica oggetti o variabili che sono esistiti prima che fosse chiamata.
469+
* **Gli stessi input, lo stesso output.** Dati gli stessi input, una funzione pura dovrebbe sempre restituire lo stesso risultato.
471470

472-
By strictly only writing your components as pure functions, you can avoid an entire class of baffling bugs and unpredictable behavior as your codebase grows. Here is an example of an impure component:
471+
Scrivendo strettamente i tuoi componenti solo come funzioni pure, puoi evitare un'intera classe di errori strani e comportamenti imprevedibili man mano che la tua base di codice cresce. Ecco un esempio di componente non puro:
473472

474473
<Sandpack>
475474

@@ -495,7 +494,7 @@ export default function TeaSet() {
495494

496495
</Sandpack>
497496

498-
You can make this component pure by passing a prop instead of modifying a preexisting variable:
497+
Puoi rendere questo componente puro passando una prop invece di modificare una variabile esistente:
499498

500499
<Sandpack>
501500

@@ -519,12 +518,12 @@ export default function TeaSet() {
519518

520519
<LearnMore path="/learn/keeping-components-pure">
521520

522-
Read **[Keeping Components Pure](/learn/keeping-components-pure)** to learn how to write components as pure, predictable functions.
521+
Leggi **[Mantenere i Componenti Puri](/learn/keeping-components-pure)** per imparare a scrivere componenti come funzioni pure e prevedibili.
523522

524523
</LearnMore>
525524

526-
## What's next? {/*whats-next*/}
525+
## Qual è il Prossimo Passo? {/*whats-next*/}
527526

528-
Head over to [Your First Component](/learn/your-first-component) to start reading this chapter page by page!
527+
Vai a [Il Tuo Primo Componente](/learn/your-first-component) per iniziare a leggere questa pagina del capitolo pagina per pagina!
529528

530-
Or, if you're already familiar with these topics, why not read about [Adding Interactivity](/learn/adding-interactivity)?
529+
Oppure, se sei già familiare con questi argomenti, perché non leggere su [Aggiungere Interattività](/learn/adding-interactivity)?

Diff for: src/sidebarLearn.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"sectionHeader": "LEARN REACT"
4848
},
4949
{
50-
"title": "Describing the UI",
50+
"title": "Descrivere la UI",
5151
"tags": [],
5252
"path": "/learn/describing-the-ui",
5353
"routes": [

0 commit comments

Comments
 (0)