Skip to content

Commit 64782a9

Browse files
authored
Reference/index translated (#455)
1 parent d9af579 commit 64782a9

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

Diff for: src/content/reference/react/index.md

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
title: "Built-in React Hooks"
2+
title: "React Hooks integrati"
33
---
44

55
<Intro>
66

7-
*Hooks* let you use different React features from your components. You can either use the built-in Hooks or combine them to build your own. This page lists all built-in Hooks in React.
7+
Gli *Hooks* ti consentono di utilizzare diverse funzionalità di React attraverso i tuoi componenti. Puoi utilizzare gli Hooks integrati oppure puoi combinarli per crearne uno tuo. Questa pagina pagina elenca tutti gli Hooks già integrati in React.
88

99
</Intro>
1010

1111
---
1212

1313
## State Hooks {/*state-hooks*/}
1414

15-
*State* lets a component ["remember" information like user input.](/learn/state-a-components-memory) For example, a form component can use state to store the input value, while an image gallery component can use state to store the selected image index.
15+
Lo *State* consente a un componente di ["ricordare" informazioni come l'input di un utente.](/learn/state-a-components-memory) Ad esempio, un componente form può utilizzare lo State per memorizzare il valore di un input, mentre un componente galleria di immagini può utilizzare lo State per memorizzare l'indice dell'immagine attualmente selezionata.
1616

17-
To add state to a component, use one of these Hooks:
17+
Per aggiungere lo State ad un componente, utilizza uno di questi Hooks:
1818

19-
* [`useState`](/reference/react/useState) declares a state variable that you can update directly.
20-
* [`useReducer`](/reference/react/useReducer) declares a state variable with the update logic inside a [reducer function.](/learn/extracting-state-logic-into-a-reducer)
19+
* [`useState`](/reference/react/useState) dichiara una variabile di stato che puoi aggiornare direttamente.
20+
* [`useReducer`](/reference/react/useReducer) dichiara una variabile di stato con la logica di aggiornamento all'interno di una [funzione reducer.](/learn/extracting-state-logic-into-a-reducer)
2121

2222
```js
2323
function ImageGallery() {
@@ -29,9 +29,9 @@ function ImageGallery() {
2929
3030
## Context Hooks {/*context-hooks*/}
3131
32-
*Context* lets a component [receive information from distant parents without passing it as props.](/learn/passing-props-to-a-component) For example, your app's top-level component can pass the current UI theme to all components below, no matter how deep.
32+
Il *Context* consente a un componente di [ricevere informazioni da elementi genitori lontani senza che vengano passate tramite props.](/learn/passing-props-to-a-component) Ad esempio, il componente di primo livello della tua app può passare il tema dell'interfaccia utente corrente a tutti i componenti sottostanti, indipendentemente dalla profondità.
3333
34-
* [`useContext`](/reference/react/useContext) reads and subscribes to a context.
34+
* [`useContext`](/reference/react/useContext) legge ed aderisce a un contesto.
3535
3636
```js
3737
function Button() {
@@ -43,10 +43,10 @@ function Button() {
4343
4444
## Ref Hooks {/*ref-hooks*/}
4545
46-
*Refs* let a component [hold some information that isn't used for rendering,](/learn/referencing-values-with-refs) like a DOM node or a timeout ID. Unlike with state, updating a ref does not re-render your component. Refs are an "escape hatch" from the React paradigm. They are useful when you need to work with non-React systems, such as the built-in browser APIs.
46+
I *Ref* consentono a un componente di [conservare alcune informazioni che non vengono usate per il rendering,](/learn/referencing-values-with-refs) come un nodo DOM o un timeout ID. A differenza dello State, l'aggiornamento di un Ref non esegue nuovamente il rendering del componente. I Ref sono una "via di fuga" dal paradigma React. Sono utili quando devi lavorare con sistemi non React, come le API del browser integrate.
4747
48-
* [`useRef`](/reference/react/useRef) declares a ref. You can hold any value in it, but most often it's used to hold a DOM node.
49-
* [`useImperativeHandle`](/reference/react/useImperativeHandle) lets you customize the ref exposed by your component. This is rarely used.
48+
* [`useRef`](/reference/react/useRef) dichiara un Ref. Puoi assegnare qualsiasi valore, ma molto spesso viene utilizzato per contenere un nodo DOM.
49+
* [`useImperativeHandle`](/reference/react/useImperativeHandle) ti consente di personalizzare il Ref esposto dal tuo componente. Questo viene usato raramente.
5050
5151
```js
5252
function Form() {
@@ -58,9 +58,9 @@ function Form() {
5858
5959
## Effect Hooks {/*effect-hooks*/}
6060
61-
*Effects* let a component [connect to and synchronize with external systems.](/learn/synchronizing-with-effects) This includes dealing with network, browser DOM, animations, widgets written using a different UI library, and other non-React code.
61+
Gli *Effects* consentono a un componente di [connettersi e sincronizzarsi con sistemi esterni.](/learn/synchronizing-with-effects) Ciò include la gestione della rete, il DOM del browser, animazioni, widgets scritti utilizzando diverse librerie di UI e per altro codice non-React.
6262
63-
* [`useEffect`](/reference/react/useEffect) connects a component to an external system.
63+
* [`useEffect`](/reference/react/useEffect) collega un componente a un sistema esterno.
6464
6565
```js
6666
function ChatRoom({ roomId }) {
@@ -72,23 +72,23 @@ function ChatRoom({ roomId }) {
7272
// ...
7373
```
7474
75-
Effects are an "escape hatch" from the React paradigm. Don't use Effects to orchestrate the data flow of your application. If you're not interacting with an external system, [you might not need an Effect.](/learn/you-might-not-need-an-effect)
75+
Gli Effects sono una "via di fuga" dal paradigma React. Non utilizzare gli Effects per orchestrare il flusso di dati della tua applicazione. Se non stai interagendo con un sistema esterno, [potresti non aver bisogno di un Effect.](/learn/you-might-not-need-an-effect)
7676
77-
There are two rarely used variations of `useEffect` with differences in timing:
77+
Ci sono due varianti di `useEffect`, usate raramente e con differenze di temporizzazione:
7878
79-
* [`useLayoutEffect`](/reference/react/useLayoutEffect) fires before the browser repaints the screen. You can measure layout here.
80-
* [`useInsertionEffect`](/reference/react/useInsertionEffect) fires before React makes changes to the DOM. Libraries can insert dynamic CSS here.
79+
* [`useLayoutEffect`](/reference/react/useLayoutEffect) si attiva prima che il browser ridisegni lo schermo. Qui Puoi misurare il layout.
80+
* [`useInsertionEffect`](/reference/react/useInsertionEffect) attiva prima che React apporti modifiche al DOM. Le librerie possono inserire CSS dinamici qui.
8181
8282
---
8383
8484
## Performance Hooks {/*performance-hooks*/}
8585
86-
A common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell React to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.
86+
Un metodo comune per ottimizzare le prestazioni del nuovo rendering consiste nell'evitare il lavoro non necessario. Ad esempio, puoi dire a React di riutilizzare un calcolo memorizzato nella cache o di saltare un nuovo rendering se i dati non sono cambiati dal rendering precedente.
8787
88-
To skip calculations and unnecessary re-rendering, use one of these Hooks:
88+
Per saltare i calcoli e il re-rendering non necessario, usa uno di questi Hooks:
8989
90-
- [`useMemo`](/reference/react/useMemo) lets you cache the result of an expensive calculation.
91-
- [`useCallback`](/reference/react/useCallback) lets you cache a function definition before passing it down to an optimized component.
90+
- [`useMemo`](/reference/react/useMemo) permette di salvare nella cache il risultato di un calcolo dispendioso.
91+
- [`useCallback`](/reference/react/useCallback) permette di conservare nella cache la definizione di una funzione prima di passarla a un componente ottimizzato.
9292
9393
```js
9494
function TodoList({ todos, tab, theme }) {
@@ -97,25 +97,25 @@ function TodoList({ todos, tab, theme }) {
9797
}
9898
```
9999
100-
Sometimes, you can't skip re-rendering because the screen actually needs to update. In that case, you can improve performance by separating blocking updates that must be synchronous (like typing into an input) from non-blocking updates which don't need to block the user interface (like updating a chart).
100+
A volte, non puoi saltare il nuovo rendering perché lo schermo deve effettivamente essere aggiornato. In questo caso, puoi migliorare le prestazioni separando gli aggiornamenti bloccanti che devono essere sincroni (come la digitazione in un input) dagli aggiornamenti non bloccanti che non devono bloccare l'interfaccia utente (come l'aggiornamento di un grafico).
101101
102-
To prioritize rendering, use one of these Hooks:
102+
Per dare la priorità al rendering, utilizza uno di questi Hooks:
103103
104-
- [`useTransition`](/reference/react/useTransition) lets you mark a state transition as non-blocking and allow other updates to interrupt it.
105-
- [`useDeferredValue`](/reference/react/useDeferredValue) lets you defer updating a non-critical part of the UI and let other parts update first.
104+
- [`useTransition`](/reference/react/useTransition) consente di contrassegnare una transizione di stato come non bloccante e di permettere ad altri aggiornamenti di interromperla.
105+
- [`useDeferredValue`](/reference/react/useDeferredValue) consente di posticipare l'aggiornamento di una parte non critica dell'interfaccia utente e di permettere l'aggiornamento delle altre parti per prime.
106106
107107
---
108108
109-
## Other Hooks {/*other-hooks*/}
109+
## Altri Hooks {/*other-hooks*/}
110110
111-
These Hooks are mostly useful to library authors and aren't commonly used in the application code.
111+
Questi Hooks sono per lo più utili agli autori di librerie e non sono comunemente usati nel codice dell'applicazione.
112112
113-
- [`useDebugValue`](/reference/react/useDebugValue) lets you customize the label React DevTools displays for your custom Hook.
114-
- [`useId`](/reference/react/useId) lets a component associate a unique ID with itself. Typically used with accessibility APIs.
115-
- [`useSyncExternalStore`](/reference/react/useSyncExternalStore) lets a component subscribe to an external store.
113+
- [`useDebugValue`](/reference/react/useDebugValue) consente di personalizzare l'etichetta visualizzata da React DevTools per il tuo Hook personalizzato.
114+
- [`useId`](/reference/react/useId) consente a un componente di associare un ID univoco a se stesso. Generalmente utilizzato con le API di accessibilità.
115+
- [`useSyncExternalStore`](/reference/react/useSyncExternalStore) consente a un componente di iscriversi a un archivio esterno.
116116
117117
---
118118
119-
## Your own Hooks {/*your-own-hooks*/}
119+
## I tuoi Hooks {/*your-own-hooks*/}
120120
121-
You can also [define your own custom Hooks](/learn/reusing-logic-with-custom-hooks#extracting-your-own-custom-hook-from-a-component) as JavaScript functions.
121+
Puoi anche [definire i tuoi Hooks personalizzati](/learn/reusing-logic-with-custom-hooks#extracting-your-own-custom-hook-from-a-component) come funzioni JavaScript.

0 commit comments

Comments
 (0)