Skip to content

Composition vs Inheritance #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 17, 2019

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?


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.

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


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.

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


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.

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


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.

у тисячах компонентів замість в тисячах компонентів


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.

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


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


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

@@ -106,14 +106,14 @@ 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