Skip to content

Commit 1b4cf97

Browse files
committed
Traduzione ID in linguar ORIGINALE
1 parent 4d65b6d commit 1b4cf97

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: content/docs/faq-ajax.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ layout: docs
66
category: FAQ
77
---
88

9-
### Come posso fare una chiamata AJAX ? {#come-posso-fare-una-chiamata-ajax}
9+
### Come posso fare una chiamata AJAX ? {#how-can-i-make-an-ajax-call}
1010

1111
Puoi usare qualsiasi libreria AJAX con React. Le piu popolari sono [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), e il e il browser integrato [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
1212

13-
### In quale punto del ciclo di vita del componente devo effettuare una chiamata AJAX? {#dove-nel-ciclo-di-vita-del-componente-dovrei-fare-una-chiamata-ajax}
13+
### In quale punto del ciclo di vita del componente devo effettuare una chiamata AJAX? {#where-in-the-component-lifecycle-should-i-make-an-ajax-call}
1414

1515
Dovresti popolare i dati con chiamate AJAX nel metodo [`componentDidMount`](/docs/react-component.html#mounting). In questo modo puoi usare `setState` per aggiornare il tuo componente quando i dati vengono recuperati.
1616

17-
### Esempio: utilizzo dei risultati AJAX per impostare lo stato locale {#esempio-usando-ajax-risultati-impostare-lo-stato-locale}
17+
### Esempio: utilizzo dei risultati AJAX per impostare lo stato locale {#example-using-ajax-results-to-set-local-state}
1818

1919
Il componente seguente mostra come effettuare una chiamata AJAX in `componentDidMount` per popolare lo stato del componente locale.
2020

@@ -50,9 +50,9 @@ class MyComponent extends React.Component {
5050
items: result.items
5151
});
5252
},
53-
// Note: it's important to handle errors here
54-
// instead of a catch() block so that we don't swallow
55-
// exceptions from actual bugs in components.
53+
// Nota: è importante gestire gli errori qui
54+
// invece di un blocco catch() in modo da non fare passare
55+
// eccezioni da bug reali nei componenti.
5656
(error) => {
5757
this.setState({
5858
isLoaded: true,
@@ -92,9 +92,9 @@ function MyComponent() {
9292
const [items, setItems] = useState([]);
9393

9494

95-
// Note: the empty deps array [] means
96-
// this useEffect will run once
97-
// similar to componentDidMount()
95+
// Nota: l'array deps vuoto [] significa
96+
// questo useEffect verrà eseguito una volta
97+
// simile a componentDidMount()
9898
useEffect(() => {
9999
fetch("https://api.example.com/items")
100100
.then(res => res.json())
@@ -103,9 +103,9 @@ function MyComponent() {
103103
setIsLoaded(true);
104104
setItems(result);
105105
},
106-
// Note: it's important to handle errors here
107-
// instead of a catch() block so that we don't swallow
108-
// exceptions from actual bugs in components.
106+
// Nota: è importante gestire gli errori qui
107+
// invece di un blocco catch() in modo da non fare passare
108+
// eccezioni da bug reali nei componenti.
109109
(error) => {
110110
setIsLoaded(true);
111111
setError(error);

0 commit comments

Comments
 (0)