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
Queste due linee di codice servono a trovare il `<div>` che abbiamo aggiunto al nostro HTML nel passo 1 e a visualizzare il nostro componente React del bottone "Mi Piace" al suo interno.
96
-
=======
97
-
These two lines of code find the `<div>` we added to our HTML in the first step, and then display our "Like" button React component inside of it.
Copy file name to clipboardExpand all lines: content/docs/reference-events.md
+5-66
Original file line number
Diff line number
Diff line change
@@ -34,41 +34,11 @@ string type
34
34
35
35
> Nota:
36
36
>
37
-
<<<<<<< HEAD
38
-
> A partire da v0.14, ritornare `false` da un event handler non fermerà la propagazione dell'evento come avveniva in precedenza. Invece, `e.stopPropagation()` o `e.preventDefault()` dovrebbero essere invocati manualmente, ove opportuno.
39
-
40
-
### Pooling degli Eventi {#event-pooling}
41
-
42
-
`SyntheticEvent` è _pooled_, ovvero "accomunato". Questo significa che un oggetto `SyntheticEvent` sarà riutilizzato e che tutte proprietà verranno resettate a `null` non appena la callback dell'evento è stata invocata.
43
-
Ciò avviene per migliorare le prestazioni.
44
-
Per questo, non puoi avere accesso all'evento in modo asincrono.
45
-
46
-
```javascript
47
-
functiononClick(event) {
48
-
console.log(event); // => oggetto nullifficato.
49
-
console.log(event.type); // => "click"
50
-
consteventType=event.type; // => "click"
51
-
52
-
setTimeout(function() {
53
-
console.log(event.type); // => null
54
-
console.log(eventType); // => "click"
55
-
}, 0);
56
-
57
-
// Non funzionerebbe. this.state.clickEvent conterrà solo valori nulli
58
-
this.setState({clickEvent:event});
59
-
60
-
// YPuoi comunque esportare le proprietà dell'evento.
61
-
this.setState({eventType:event.type});
62
-
}
63
-
```
64
-
=======
65
-
> As of v17, `e.persist()` doesn't do anything because the `SyntheticEvent` is no longer [pooled](/docs/legacy-event-pooling.html).
66
-
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
37
+
> A partire da v17, `e.persist()` non fa più nulla in quanto `SyntheticEvent` non è più [pooled](/docs/legacy-event-pooling.html).
67
38
68
39
> Nota:
69
40
>
70
-
<<<<<<< HEAD
71
-
> Se vuoi avere accesso alle proprietà in modo asincrono, dovresti invocare `event.persist()` sull'evento, il quale rimuoverà l'evento sintetico dal pool permettendo ai riferimenti all'evento di rimanere mantenuti dal codice utente.
41
+
> A partire da v0.14, ritornare `false` da un event handler non fermerà più la propagazione dell'evento. In modo più appropriato, è invece necessario invocare `e.stopPropagation()` o `e.preventDefault()`.
72
42
73
43
## Eventi Supportati {#supported-events}
74
44
@@ -93,33 +63,6 @@ Gli event handlers di seguito vengono scatenati da un evento nella fase di [bubb
93
63
-[Eventi delle Animazioni](#animation-events)
94
64
-[Eventi della Transizione](#transition-events)
95
65
-[Altri Eventi](#other-events)
96
-
=======
97
-
> As of v0.14, returning `false` from an event handler will no longer stop event propagation. Instead, `e.stopPropagation()` or `e.preventDefault()` should be triggered manually, as appropriate.
98
-
99
-
## Supported Events {#supported-events}
100
-
101
-
React normalizes events so that they have consistent properties across different browsers.
102
-
103
-
The event handlers below are triggered by an event in the bubbling phase. To register an event handler for the capture phase, append `Capture` to the event name; for example, instead of using `onClick`, you would use `onClickCapture` to handle the click event in the capture phase.
104
-
105
-
-[Clipboard Events](#clipboard-events)
106
-
-[Composition Events](#composition-events)
107
-
-[Keyboard Events](#keyboard-events)
108
-
-[Focus Events](#focus-events)
109
-
-[Form Events](#form-events)
110
-
-[Generic Events](#generic-events)
111
-
-[Mouse Events](#mouse-events)
112
-
-[Pointer Events](#pointer-events)
113
-
-[Selection Events](#selection-events)
114
-
-[Touch Events](#touch-events)
115
-
-[UI Events](#ui-events)
116
-
-[Wheel Events](#wheel-events)
117
-
-[Media Events](#media-events)
118
-
-[Image Events](#image-events)
119
-
-[Animation Events](#animation-events)
120
-
-[Transition Events](#transition-events)
121
-
-[Other Events](#other-events)
122
-
>>>>>>> 6682068641c16df6547b3fcdb7877e71bb0bebf9
123
66
124
67
* * *
125
68
@@ -411,15 +354,11 @@ Nomi degli eventi:
411
354
onScroll
412
355
```
413
356
414
-
<<<<<<< HEAD
415
-
Proprietà:
416
-
=======
417
-
>Note
357
+
>Nota
418
358
>
419
-
>Starting with React 17, the`onScroll`event **does not bubble** in React. This matches the browser behavior and prevents the confusion when a nested scrollable element fires events on a distant parent.
359
+
>A partire da React 17, l'evento`onScroll`**non fa bubble** in React. Si comporta quindi come il browser e previene la confusione che si ha quando un elemendo scrollabile nidificato lancia eventi su genitori distanti nel DOM.
0 commit comments