Skip to content

Commit 2791887

Browse files
Translate legacy event pooling
1 parent bf4e367 commit 2791887

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
---
22
id: legacy-event-pooling
3-
title: Event Pooling
3+
title: Hadisə Pulinqı
44
permalink: docs/legacy-event-pooling.html
55
---
66

7-
>Note
7+
>Qeyd
88
>
9-
>This page is only relevant for React 16 and earlier, and for React Native.
9+
>Bu səhifə yalnız React 16 və köhnə versiyaları və React Native üçün münasibdir.
1010
>
11-
>React 17 on the web **does not** use event pooling.
11+
>React 17 vebdə event pulinqından **istifadə etmir**.
1212
>
13-
>[Read more](/blog/2020/08/10/react-v17-rc.html#no-event-pooling) about this change in React 17.
13+
>React 17-dəki bu dəyişiklik haqqında əlavə məlumat almaq üçün [bu bloq yazısını oxuyun](/blog/2020/08/10/react-v17-rc.html#no-event-pooling).
1414
15-
The [`SyntheticEvent`](/docs/events.html) objects are pooled. This means that the `SyntheticEvent` object will be reused and all properties will be nullified after the event handler has been called. For example, this won't work:
15+
[`SyntheticEvent`](/docs/events.html) obyektləri pul olunurlar. Bu deməkdir ki, hadisə callback-i çağrıldıqdan sonra `SyntheticEvent` obyekti yenidən işlədiləcək və bütün parametrləri sıfırlanacaq. Məsələn, aşağıdakı kod işləməyəcək:
1616

1717
```javascript
1818
function handleChange(e) {
19-
// This won't work because the event object gets reused.
19+
// Hadisə obyekti yenidən işlənir deyə bu işləməyəcək.
2020
setTimeout(() => {
21-
console.log(e.target.value); // Too late!
21+
console.log(e.target.value); // Çox gecdir!
2222
}, 100);
2323
}
2424
```
2525

26-
If you need to access event object's properties after the event handler has run, you need to call `e.persist()`:
26+
Hadisə işləyicisi icra olunduqdan sonra hadisənin dəyərlərini oxuya bilmək üçün `e.persist()` funksiyasını çağırmaq lazımdır:
2727

2828
```javascript
2929
function handleChange(e) {
30-
// Prevents React from resetting its properties:
30+
// React-in hadisə parametrlərini sıfırlarmasının qarşısını alır:
3131
e.persist();
3232

3333
setTimeout(() => {
34-
console.log(e.target.value); // Works
34+
console.log(e.target.value); // İşləyəcək
3535
}, 100);
3636
}
3737
```

0 commit comments

Comments
 (0)