Skip to content

Conversation

mihilbabin
Copy link
Contributor

Added translation for Composition vs Inheritance section.

@mihilbabin
Copy link
Contributor Author

Should be merged after #9.

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.

Дякую за переклад 😀
Лише декілька виправлень, а так виглядає дуже гарно. Можеш також будь-ласка прибрати handling-events.md з цього PR?

## Запобіжні заходи {#containment}

Some components don't know their children ahead of time. This is especially common for components like `Sidebar` or `Dialog` that represent generic "boxes".
Деякі компоненти не знають зарані про свої дочірні елементи. Це особливо характерно для таких компонентів як `Sidebar` чи `Dialog`, котрі представляють собою загальні контейнери.
Copy link
Member

Choose a reason for hiding this comment

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

заздалегідь замість зарані

**[Спробувати на CodePen](https://codepen.io/gaearon/pen/ozqNOV?editors=0010)**

Anything inside the `<FancyBorder>` JSX tag gets passed into the `FancyBorder` component as a `children` prop. Since `FancyBorder` renders `{props.children}` inside a `<div>`, the passed elements appear in the final output.
Усе, що знаходиться між JSX тегом `<FancyBorder>` буде передане в `FancyBorder` компонент як `children` проп. Оскільки `FancyBorder` рендерить `{props.children}` всередині `<div>`, передані елементи з'являться в фінальному виводі.
Copy link
Member

Choose a reason for hiding this comment

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

у фінальному виводі замість в фінальному виводі

Усе, що знаходиться між JSX тегом `<FancyBorder>` буде передане в `FancyBorder` компонент як `children` проп. Оскільки `FancyBorder` рендерить `{props.children}` всередині `<div>`, передані елементи з'являться в фінальному виводі.

While this is less common, sometimes you might need multiple "holes" in a component. In such cases you may come up with your own convention instead of using `children`:
Іноді, хоч і не так часто, вам може знадобитись кілька подібних "слотів" у компоненті. В таких випадках ви можети придумати власне рішення замість використання `children`:
Copy link
Member

Choose a reason for hiding this comment

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

У таких випадках

## То що з приводу наслідування? {#so-what-about-inheritance}

At Facebook, we use React in thousands of components, and we haven't found any use cases where we would recommend creating component inheritance hierarchies.
У Facebook ми використовуємо 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-елементами чи функціями.

If you want to reuse non-UI functionality between components, we suggest extracting it into a separate JavaScript module. The components may import it and use that function, object, or a class, without extending it.
Якщо ви хочете повторно використати функціональність котра не відноситься до інтерфейсу користувача, ми рекомендуємо виокремити її в окремий JavaScript модуль. Компоненти можуть імпортувати його і використувати функцію, об'єкт чи клас без наслідування.
Copy link
Member

Choose a reason for hiding this comment

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

витягнути її в окремий замість виокреми її в окремий

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

If you want to reuse non-UI functionality between components, we suggest extracting it into a separate JavaScript module. The components may import it and use that function, object, or a class, without extending it.
Якщо ви хочете повторно використати функціональність котра не відноситься до інтерфейсу користувача, ми рекомендуємо витягнути її в окремий JavaScript модуль. Компоненти можуть імпортувати його і використувати функцію, об'єкт чи клас без наслідування.
Copy link
Collaborator

Choose a reason for hiding this comment

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

, котра missing comma

## То що з приводу наслідування? {#so-what-about-inheritance}

At Facebook, we use React in thousands of components, and we haven't found any use cases where we would recommend creating component inheritance hierarchies.
У Facebook ми використовуємо React у тисячах компонентів і ми не знайшли жодного випадку використання в якому б ми могли порадити створення ієрархій наслідування компонентів.
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing comma , в якому or , у якому

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.

1 small change

function WelcomeDialog() {
return (
<Dialog
title="Welcome"
Copy link
Member

Choose a reason for hiding this comment

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

Перекласти Welcome

@vldmrkl
Copy link
Member

vldmrkl commented Feb 17, 2019

@mihilbabin looks good, thank you for contribution :)

@vldmrkl vldmrkl merged commit cfaf4b7 into reactjs:master Feb 17, 2019
@mihilbabin mihilbabin deleted the i18n/composition-vs-inheritance branch March 31, 2019 14:39
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