Skip to content

Commit 7379064

Browse files
authored
Merge branch 'master' into reference-glossary
2 parents bbfd0b2 + d8ea85c commit 7379064

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+830
-605
lines changed

Diff for: GLOSSARY.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Glossary of the translations of technical and React-specific terms.
55
## Untranslatable terms
66
- props (**core concept**)
77
- state (**core concept**)
8+
- hooks (**core concept**)
9+
- ref (**core concept**)
810
- footer
911
- bug
1012
- browser
@@ -21,6 +23,10 @@ Glossary of the translations of technical and React-specific terms.
2123
- console
2224
- warning
2325
- form/forms
26+
- render props
27+
- strict mode
28+
- web components
29+
- build steps
2430

2531
# Common Translations
2632

Diff for: content/blog/2015-12-18-react-components-elements-and-instances.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ React will ask the `Form` component what element tree it returns, given those `p
350350
}
351351
```
352352
353-
This is a part of the process that React calls [reconciliation](/docs/reconciliation.html) which starts when you call [`ReactDOM.render()`](/docs/top-level-api.html#reactdom.render) or [`setState()`](/docs/component-api.html#setstate). By the end of the reconciliation, React knows the result DOM tree, and a renderer like `react-dom` or `react-native` applies the minimal set of changes necessary to update the DOM nodes (or the platform-specific views in case of React Native).
353+
This is a part of the process that React calls [riconciliazione](/docs/reconciliation.html) which starts when you call [`ReactDOM.render()`](/docs/top-level-api.html#reactdom.render) or [`setState()`](/docs/component-api.html#setstate). By the end of the reconciliation, React knows the result DOM tree, and a renderer like `react-dom` or `react-native` applies the minimal set of changes necessary to update the DOM nodes (or the platform-specific views in case of React Native).
354354
355355
This gradual refining process is also the reason React apps are easy to optimize. If some parts of your component tree become too large for React to visit efficiently, you can tell it to [skip this “refining” and diffing certain parts of the tree if the relevant props have not changed](/docs/advanced-performance.html). It is very fast to calculate whether the props have changed if they are immutable, so React and immutability work great together, and can provide great optimizations with the minimal effort.
356356

Diff for: content/blog/2017-09-08-dom-attributes-in-react-16.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Just like before, React lets you pass `data-` and `aria-` attributes freely:
8080

8181
This has not changed.
8282

83-
[Accessibility](/docs/accessibility.html) is very important, so even though React 16 passes any attributes through, it still validates that `aria-` props have correct names in development mode, just like React 15 did.
83+
[Accessibilità](/docs/accessibility.html) is very important, so even though React 16 passes any attributes through, it still validates that `aria-` props have correct names in development mode, just like React 15 did.
8484

8585
## Migration Path {#migration-path}
8686

Diff for: content/community/conferences.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ June 21, 2019 Chicago, Illinois USA
5252

5353
[Website](https://reactloop.com) - [Twitter](https://twitter.com/ReactLoop)
5454

55-
### React Week '19 {#RWNY19}
56-
July 15-21, 2019. New York City, USA
57-
58-
[Website](https://reactweek.nyc) - [Twitter](https://twitter.com/ReactWeek)
59-
60-
### React Rally 2019
55+
### React Rally 2019 {#react-rally-2019}
6156
August 22-23, 2019. Salt Lake City, USA.
6257

6358
[Website](https://www.reactrally.com/) - [Twitter](https://twitter.com/ReactRally) - [Instagram](https://www.instagram.com/reactrally/)

Diff for: content/community/meetups.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
8888

8989
## Pakistan {#pakistan}
9090
* [Karachi](https://www.facebook.com/groups/902678696597634/)
91+
* [Lahore](https://www.facebook.com/groups/ReactjsLahore/)
9192

9293
## Peru {#peru}
9394
* [Lima](https://www.meetup.com/ReactJS-Peru/)
@@ -130,8 +131,8 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
130131
* [New York, NY - ReactJS](https://www.meetup.com/NYC-Javascript-React-Group/)
131132
* [New York, NY - React Ladies](https://www.meetup.com/React-Ladies/)
132133
* [New York, NY - React Native](https://www.meetup.com/React-Native-NYC/)
133-
* [New York, NY - ReactNYC](https://www.meetup.com/ReactNYC/)
134134
* [Palo Alto, CA - React Native](https://www.meetup.com/React-Native-Silicon-Valley/)
135+
* [Philadelphia, PA - ReactJS](https://www.meetup.com/RQ-React/)
135136
* [Phoenix, AZ - ReactJS](https://www.meetup.com/ReactJS-Phoenix/)
136137
* [Pittsburgh, PA - ReactJS/React Native](https://www.meetup.com/ReactPgh/)
137138
* [Portland, OR - ReactJS](https://www.meetup.com/Portland-ReactJS/)

Diff for: content/docs/accessibility.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: accessibility
3-
title: Accessibility
3+
title: Accessibilità
44
permalink: docs/accessibility.html
55
---
66

Diff for: content/docs/add-react-to-a-website.md

+84-85
Large diffs are not rendered by default.

Diff for: content/docs/addons-animation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ It is also possible to use custom class names for each of the steps in your tran
173173

174174
In order for it to apply transitions to its children, the `ReactCSSTransitionGroup` must already be mounted in the DOM or the prop `transitionAppear` must be set to `true`.
175175

176-
The example below would **not** work, because the `ReactCSSTransitionGroup` is being mounted along with the new item, instead of the new item being mounted within it. Compare this to the [Getting Started](#getting-started) section above to see the difference.
176+
The example below would **not** work, because the `ReactCSSTransitionGroup` is being mounted along with the new item, instead of the new item being mounted within it. Compare this to the [Primi Passi](#getting-started) section above to see the difference.
177177

178178
```javascript{4,6,13}
179179
render() {

Diff for: content/docs/addons-test-utils.md

+49-49
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ layout: docs
66
category: Reference
77
---
88

9-
**Importing**
9+
**Importazione**
1010

1111
```javascript
1212
import ReactTestUtils from 'react-dom/test-utils'; // ES6
13-
var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm
13+
var ReactTestUtils = require('react-dom/test-utils'); // ES5 con npm
1414
```
1515

16-
## Overview {#overview}
16+
## Panoramica {#overview}
1717

18-
`ReactTestUtils` makes it easy to test React components in the testing framework of your choice. At Facebook we use [Jest](https://facebook.github.io/jest/) for painless JavaScript testing. Learn how to get started with Jest through the Jest website's [React Tutorial](https://jestjs.io/docs/tutorial-react).
18+
`ReactTestUtils` rende semplice testare i componenti React all'interno del framework di test che preferisci. In Facebook usiamo [Jest](https://facebook.github.io/jest/) per scrivere test in JavaScript. Impara come utilizzare Jest tramite il sito ufficiale [React Tutorial](https://jestjs.io/docs/tutorial-react).
1919

20-
> Note:
20+
> Nota:
2121
>
22-
> We recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to enable and encourage writing tests that use your components as the end users do.
22+
> Suggeriamo l'utilizzo di [`react-testing-library`](https://git.io/react-testing-library), concepito per abilitare e favorire la scrittura di test che simulano il reale utilizzo dei componenti.
2323
>
24-
> Alternatively, Airbnb has released a testing utility called [Enzyme](https://airbnb.io/enzyme/), which makes it easy to assert, manipulate, and traverse your React Components' output.
24+
> In alternativa, Airbnb ha rilasciato una libreria per i test chiamata [Enzyme](https://airbnb.io/enzyme/), che semplifica le operazioni di verifica, manipolazione ed analisi dell'output dei tuoi componenti.
2525
2626
- [`act()`](#act)
2727
- [`mockComponent()`](#mockcomponent)
@@ -40,17 +40,17 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm
4040
- [`renderIntoDocument()`](#renderintodocument)
4141
- [`Simulate`](#simulate)
4242

43-
## Reference {#reference}
43+
## Riferimento {#reference}
4444

4545
### `act()` {#act}
4646

47-
To prepare a component for assertions, wrap the code rendering it and performing updates inside an `act()` call. This makes your test run closer to how React works in the browser.
47+
Per preparare un componente per le verifiche, racchiudi il codice che lo renderizza e lo aggiorna all'interno di una chiamata `act()`. Questo permette di simulare un comportamento che si avvicina a quello reale di React.
4848

49-
>Note
49+
>Nota
5050
>
51-
>If you use `react-test-renderer`, it also provides an `act` export that behaves the same way.
51+
>Se utilizzi `react-test-renderer`, hai a disposizione un modulo `act` che funziona allo stesso modo.
5252
53-
For example, let's say we have this `Counter` component:
53+
Ad esempio, prendiamo in considerazione il seguente componente `Counter`:
5454

5555
```js
5656
class Counter extends React.Component {
@@ -60,10 +60,10 @@ class Counter extends React.Component {
6060
this.handleClick = this.handleClick.bind(this);
6161
}
6262
componentDidMount() {
63-
document.title = `You clicked ${this.state.count} times`;
63+
document.title = `Hai cliccato ${this.state.count} volte`;
6464
}
6565
componentDidUpdate() {
66-
document.title = `You clicked ${this.state.count} times`;
66+
document.title = `Hai cliccato ${this.state.count} volte`;
6767
}
6868
handleClick() {
6969
this.setState(state => ({
@@ -73,17 +73,17 @@ class Counter extends React.Component {
7373
render() {
7474
return (
7575
<div>
76-
<p>You clicked {this.state.count} times</p>
76+
<p>Hai cliccato {this.state.count} volte</p>
7777
<button onClick={this.handleClick}>
78-
Click me
78+
Cliccami
7979
</button>
8080
</div>
8181
);
8282
}
8383
}
8484
```
8585

86-
Here is how we can test it:
86+
Possiamo testarlo in questo modo:
8787

8888
```js{3,20-22,29-31}
8989
import React from 'react';
@@ -104,25 +104,25 @@ afterEach(() => {
104104
});
105105
106106
it('can render and update a counter', () => {
107-
// Test first render and componentDidMount
107+
// Testa il primo render e componentDidMount
108108
act(() => {
109109
ReactDOM.render(<Counter />, container);
110110
});
111111
const button = container.querySelector('button');
112112
const label = container.querySelector('p');
113-
expect(label.textContent).toBe('You clicked 0 times');
114-
expect(document.title).toBe('You clicked 0 times');
113+
expect(label.textContent).toBe('Hai cliccato 0 volte');
114+
expect(document.title).toBe('Hai cliccato 0 volte');
115115
116-
// Test second render and componentDidUpdate
116+
// Testa il secondo render e componentDidUpdate
117117
act(() => {
118118
button.dispatchEvent(new MouseEvent('click', {bubbles: true}));
119119
});
120-
expect(label.textContent).toBe('You clicked 1 times');
121-
expect(document.title).toBe('You clicked 1 times');
120+
expect(label.textContent).toBe('Hai cliccato 1 volte');
121+
expect(document.title).toBe('Hai cliccato 1 volte');
122122
});
123123
```
124124

125-
Don't forget that dispatching DOM events only works when the DOM container is added to the `document`. You can use a helper like [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) to reduce the boilerplate code.
125+
Non dimenticare che generare degli eventi DOM ha effetto solamente quando il contenitore dello stesso è aggiunto al `document`. Puoi usare una libreria come [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) per aumentare la pulizia del codice.
126126

127127
* * *
128128

@@ -135,11 +135,11 @@ mockComponent(
135135
)
136136
```
137137

138-
Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. Instead of rendering as usual, the component will become a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
138+
Passare il mock di un componente a questo metodo consente di migliorarlo, mettendo a disposizione delle funzionalità che permettono di utilizzare quest'ultimo come un componente React base. Il componente diventerà quindi un semplice `<div>` (o un altro tag se è presente `mockTagNme`), che conterrà degli eventuali componenti figli.
139139

140-
> Note:
140+
> Nota:
141141
>
142-
> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/shallow-renderer.html) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
142+
> `mockComponent()` è un'API legacy. Raccomandiamo l'utilizzo di [shallow rendering](/docs/shallow-renderer.html) oppure [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock).
143143
144144
* * *
145145

@@ -149,7 +149,7 @@ Pass a mocked component module to this method to augment it with useful methods
149149
isElement(element)
150150
```
151151

152-
Returns `true` if `element` is any React element.
152+
Ritorna `true` se `element` è un qualsiasi componente React.
153153

154154
* * *
155155

@@ -162,7 +162,7 @@ isElementOfType(
162162
)
163163
```
164164

165-
Returns `true` if `element` is a React element whose type is of a React `componentClass`.
165+
Ritorna `true` se `element` è un componente React di tipo `componentClass`.
166166

167167
* * *
168168

@@ -172,7 +172,7 @@ Returns `true` if `element` is a React element whose type is of a React `compone
172172
isDOMComponent(instance)
173173
```
174174

175-
Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
175+
Ritorna `true` se `instance` è un componente DOM (come un `<div>` o uno `<span>`).
176176

177177
* * *
178178

@@ -182,7 +182,7 @@ Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
182182
isCompositeComponent(instance)
183183
```
184184

185-
Returns `true` if `instance` is a user-defined component, such as a class or a function.
185+
Ritorna `true` se `instance` è un componente definito dall'utente, come una classe o una funzione.
186186

187187
* * *
188188

@@ -195,7 +195,7 @@ isCompositeComponentWithType(
195195
)
196196
```
197197

198-
Returns `true` if `instance` is a component whose type is of a React `componentClass`.
198+
Ritorna `true` se `instance` è un componente di tipo `componentClass`.
199199

200200
* * *
201201

@@ -208,7 +208,7 @@ findAllInRenderedTree(
208208
)
209209
```
210210

211-
Traverse all components in `tree` and accumulate all components where `test(component)` is `true`. This is not that useful on its own, but it's used as a primitive for other test utils.
211+
Scorre tutti i componenti nel `tree` e li accumula dove `test(component)` è `true`. Questo di per sè non è molto utile, ma è utilizzato come base in altre librerie di test.
212212

213213
* * *
214214

@@ -221,7 +221,7 @@ scryRenderedDOMComponentsWithClass(
221221
)
222222
```
223223

224-
Finds all DOM elements of components in the rendered tree that are DOM components with the class name matching `className`.
224+
Trova tutti gli elementi DOM dei componenti renderizzati, il cui nome della classe corrisponde a `className`.
225225

226226
* * *
227227

@@ -234,7 +234,7 @@ findRenderedDOMComponentWithClass(
234234
)
235235
```
236236

237-
Like [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass) but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
237+
Come [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass) ma si aspetta un solo risultato, ritornandolo oppure generando un'eccezione in caso di più risultati.
238238

239239
* * *
240240

@@ -247,7 +247,7 @@ scryRenderedDOMComponentsWithTag(
247247
)
248248
```
249249

250-
Finds all DOM elements of components in the rendered tree that are DOM components with the tag name matching `tagName`.
250+
Trova tutti gli elementi DOM dei componenti renderizzati che corrispondo al nome specifico del tag `tagName`.
251251

252252
* * *
253253

@@ -260,7 +260,7 @@ findRenderedDOMComponentWithTag(
260260
)
261261
```
262262

263-
Like [`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag) but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
263+
Come [`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag) ma si aspetta un solo risultato, ritornandolo oppure generando un'eccezione in caso di più risultati.
264264

265265
* * *
266266

@@ -273,7 +273,7 @@ scryRenderedComponentsWithType(
273273
)
274274
```
275275

276-
Finds all instances of components with type equal to `componentClass`.
276+
Trova tutte le istanze dei componenti il cui tipo è `componentClass`.
277277

278278
* * *
279279

@@ -286,7 +286,7 @@ findRenderedComponentWithType(
286286
)
287287
```
288288

289-
Same as [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
289+
Come [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) ma si aspetta un solo risultato, ritornandolo oppure generando un'eccezione in caso di più risultati.
290290

291291
***
292292

@@ -296,20 +296,20 @@ Same as [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) bu
296296
renderIntoDocument(element)
297297
```
298298

299-
Render a React element into a detached DOM node in the document. **This function requires a DOM.** It is effectively equivalent to:
299+
Renderizza un elemento React in un nodo DOM separato, all'interno del documento. **Questa funzione richiede un DOM.** Equivale a:
300300

301301
```js
302302
const domContainer = document.createElement('div');
303303
ReactDOM.render(element, domContainer);
304304
```
305305

306-
> Note:
306+
> Nota:
307307
>
308-
> You will need to have `window`, `window.document` and `window.document.createElement` globally available **before** you import `React`. Otherwise React will think it can't access the DOM and methods like `setState` won't work.
308+
> Dovrai avere `window`, `window.document` e `window.document.createElement` disponibili globalmente **prima** di importare `React`. Altrimenti React penserà di non poter accedere al DOM, e metodi come `setState` non funzioneranno.
309309
310310
* * *
311311

312-
## Other Utilities {#other-utilities}
312+
## Altre Utilities {#other-utilities}
313313

314314
### `Simulate` {#simulate}
315315

@@ -320,19 +320,19 @@ Simulate.{eventName}(
320320
)
321321
```
322322

323-
Simulate an event dispatch on a DOM node with optional `eventData` event data.
323+
Simula la generazione di un evento su un nodo DOM, con un `eventData` opzionale.
324324

325-
`Simulate` has a method for [every event that React understands](/docs/events.html#supported-events).
325+
`Simulate` ha un metodo per [ogni evento che React supporta](/docs/events.html#supported-events).
326326

327-
**Clicking an element**
327+
**Cliccare un elemento**
328328

329329
```javascript
330330
// <button ref={(node) => this.button = node}>...</button>
331331
const node = this.button;
332332
ReactTestUtils.Simulate.click(node);
333333
```
334334

335-
**Changing the value of an input field and then pressing ENTER.**
335+
**Cambiare il valore di un campo input e quindi premere ENTER**
336336

337337
```javascript
338338
// <input ref={(node) => this.textInput = node} />
@@ -342,8 +342,8 @@ ReactTestUtils.Simulate.change(node);
342342
ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13});
343343
```
344344

345-
> Note
345+
> Nota
346346
>
347-
> You will have to provide any event property that you're using in your component (e.g. keyCode, which, etc...) as React is not creating any of these for you.
347+
> Dovrai fornire qualsiasi proprietà agli eventi che usi nel tuo componente (ad esempio, keyCode, which, etc...), visto che React non ne definisce automaticamente nessuna.
348348
349349
* * *

Diff for: content/docs/cdn-links.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: cdn-links
3-
title: CDN Links
3+
title: Collegamenti a CDN
44
permalink: docs/cdn-links.html
55
prev: create-a-new-react-app.html
66
next: hello-world.html

0 commit comments

Comments
 (0)