Skip to content

Conversation

mihilbabin
Copy link
Contributor

Added uk translation for handling events.

Тут `e` - це синтетична подія. React визначає ці синтетичні події відповідно до [специфікації W3C](https://www.w3.org/TR/DOM-Level-3-Events/), тому вам не потрібно турбуватися про сумісніть між браузерами. Перегляньте довідник по [`SyntheticEvent`](/docs/events.html), щоб дізнатися більше.

When using React you should generally not need to call `addEventListener` to add listeners to a DOM element after it is created. Instead, just provide a listener when the element is initially rendered.
Зазвичай, коли ви використовуєте React, вам не потрібно викликати `addEventListener`, щоб додати обробник до DOM-елементу після його створення. Натомість, просто вкажіть обробник,коли елемент вперше відрендерився.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed space обробник,коли

Copy link
Member

@vldmrkl vldmrkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чудовий початок! Я знайшов небагато дрібних помилок, але вцілому дуже гарно 👍

```

In React, this could instead be:
В React це може виглядати так:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У React замість В React

class LoggingButton extends React.Component {
handleClick() {
console.log('this is:', this);
console.log('this це:', this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'this це:'на просто 'це:'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут під this мається на увазі ключове слово this і те чому this в контексті метода дорівнює.

```

The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem.
Проблема цього синтаксису полягає в тому, що при кожному рендері `LoggingButton` створюється щоразу нова функція зворотнього виклику. В більшості випадків це не створює додаткових проблем. Але, якщо ця функція зворотнього виклику передається в якості проп в компоненти нижче - вони можуть здійснити додатковий ререндеринг. Як правило, ми рекомендуємо зв'язувати в конструкторі або використувати синтаксис полей класу, щоб уникнути подібних проблем з продуктивністю.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прибрати щоразу

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У більшості випадків замість В більшості випадків

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Замінити передається в якості проп на передається в якості пропу

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можливо краще якості пропса. Хоч і не множина, але не має неузгодженості, коли props перекладаємо пропсів(пропси) замість пропів(пропи )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westanvv згідно нашого TRANSLATE.md, prop перекладаємо як проп, а props – як пропси.

Проблема цього синтаксису полягає в тому, що при кожному рендері `LoggingButton` створюється щоразу нова функція зворотнього виклику. В більшості випадків це не створює додаткових проблем. Але, якщо ця функція зворотнього виклику передається в якості проп в компоненти нижче - вони можуть здійснити додатковий ререндеринг. Як правило, ми рекомендуємо зв'язувати в конструкторі або використувати синтаксис полей класу, щоб уникнути подібних проблем з продуктивністю.

## Passing Arguments to Event Handlers {#passing-arguments-to-event-handlers}
## Передача аргументів у обробники подій {#passing-arguments-to-event-handlers}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

До обробників подій?

Copy link
Contributor Author

@mihilbabin mihilbabin Feb 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можна й так, параметр передається в функцію, але певно до обробника. Є пропозиція означити це в TRANSLATION.md.

```

The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem.
Проблема цього синтаксису полягає в тому, що при кожному рендері `LoggingButton` створюється щоразу нова функція зворотнього виклику. В більшості випадків це не створює додаткових проблем. Але, якщо ця функція зворотнього виклику передається в якості проп в компоненти нижче - вони можуть здійснити додатковий ререндеринг. Як правило, ми рекомендуємо зв'язувати в конструкторі або використувати синтаксис полей класу, щоб уникнути подібних проблем з продуктивністю.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можливо краще якості пропса. Хоч і не множина, але не має неузгодженості, коли props перекладаємо пропсів(пропси) замість пропів(пропи )

Copy link
Member

@vldmrkl vldmrkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job!

@vldmrkl vldmrkl merged commit 7038276 into reactjs:master Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants