Skip to content

Handling Events#9

Merged
vldmrkl merged 4 commits intoreactjs:masterfrom
mihilbabin:master
Feb 14, 2019
Merged

Handling Events#9
vldmrkl merged 4 commits intoreactjs:masterfrom
mihilbabin:master

Conversation

@mihilbabin
Copy link
Copy Markdown
Contributor

Added uk translation for handling events.

Comment thread content/docs/handling-events.md Outdated
Тут `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
Copy Markdown
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
Copy Markdown
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.

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

Comment thread content/docs/handling-events.md Outdated
Comment thread content/docs/handling-events.md Outdated
```

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

Choose a reason for hiding this comment

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

У React замість В React

Comment thread content/docs/handling-events.md Outdated
Comment thread content/docs/handling-events.md Outdated
Comment thread content/docs/handling-events.md Outdated
class LoggingButton extends React.Component {
handleClick() {
console.log('this is:', this);
console.log('this це:', this);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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 в контексті метода дорівнює.

Comment thread content/docs/handling-events.md Outdated
```

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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 – як пропси.

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

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

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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.

Comment thread content/docs/handling-events.md Outdated
```

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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