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/reference/react/Children.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,11 +164,11 @@ function Box({ children }) {
164
164
165
165
Se `children` [è un elemento valido,](/reference/react/isValidElement) restituisce quell'elemento.
166
166
167
-
Altrimenti, genera un errore.
167
+
Altrimenti, lancia un errore.
168
168
169
169
#### Caveats {/*children-only-caveats*/}
170
170
171
-
- Questo metodo **genera sempre un errore se passi un array (come il valore restituito da `Children.map`) come `children`.** In altre parole, impone che `children` sia un singolo elemento React, non che sia un array con un singolo elemento.
171
+
- Questo metodo **lancia sempre un errore se passi un array (come il valore restituito da `Children.map`) come `children`.** In altre parole, impone che `children` sia un singolo elemento React, non che sia un array con un singolo elemento.
172
172
173
173
---
174
174
@@ -300,11 +300,11 @@ export default function RowList({ children }) {
300
300
301
301
<DeepDive>
302
302
303
-
#### Perché la `children` prop non è sempre un array? {/*why-is-the-children-prop-not-always-an-array*/}
303
+
#### Perché la prop `children` non è sempre un array? {/*why-is-the-children-prop-not-always-an-array*/}
304
304
305
-
In React, la `children` prop è considerata una struttura dati *opaca*. Ciò significa che non dovresti fare affidamento su come è strutturata. Per trasformare, filtrare o contare i children, dovresti usare i metodi `Children`.
305
+
In React, la prop `children` è considerata una struttura dati *opaca*. Ciò significa che non dovresti fare affidamento su come è strutturata. Per trasformare, filtrare o contare i children, dovresti usare i metodi `Children`.
306
306
307
-
In pratica, la struttura dati `children` è spesso rappresentata internamente come un array. Tuttavia, se c'è un solo child, React non creerà un array aggiuntivo perché ciò porterebbe a un overhead di memoria non necessario. Finché usi i metodi `Children` invece di ispezionare direttamente la `children` prop, il tuo codice non si romperà anche se React cambia il modo in cui la struttura dati è effettivamente implementata.
307
+
In pratica, la struttura dati `children` è spesso rappresentata internamente come un array. Tuttavia, se c'è un solo child, React non creerà un array aggiuntivo perché ciò porterebbe a un overhead di memoria non necessario. Finché usi i metodi `Children` invece di ispezionare direttamente la prop `children`, il tuo codice non si romperà anche se React cambia il modo in cui la struttura dati è effettivamente implementata.
308
308
309
309
Anche quando `children` è un array, `Children.map` ha un comportamento speciale utile. Ad esempio, `Children.map` combina le [key](/learn/rendering-lists#keeping-list-items-in-order-with-key) sugli elementi restituiti con le key sui `children` che gli hai passato. Questo garantisce che i children JSX originali non "perdano" le key anche se vengono avvolti come nell'esempio sopra.
310
310
@@ -547,7 +547,7 @@ Questa sezione descrive alternative all'API `Children` (con la `C` maiuscola) ch
547
547
import { Children } from'react';
548
548
```
549
549
550
-
Non confonderla con [l'uso della `children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) (con la `c` minuscola), che è buona pratica ed è incoraggiato.
550
+
Non confonderla con [l'uso della prop `children`](/learn/passing-props-to-a-component#passing-jsx-as-children) (con la `c` minuscola), che è buona pratica ed è incoraggiato.
0 commit comments