-
Notifications
You must be signed in to change notification settings - Fork 125
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
Composition vs Inheritance #12
Conversation
Should be merged after #9. |
There was a problem hiding this 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`, котрі представляють собою загальні контейнери. |
There was a problem hiding this comment.
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>`, передані елементи з'являться в фінальному виводі. |
There was a problem hiding this comment.
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`: |
There was a problem hiding this comment.
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 в тисячах компонентів і ми не знайшли жодного випадку використання в якому б ми могли порадити створення ієрархій наслідування компонентів. |
There was a problem hiding this comment.
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 модуль. Компоненти можуть імпортувати його і використувати функцію, об'єкт чи клас без наслідування. |
There was a problem hiding this comment.
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 модуль. Компоненти можуть імпортувати його і використувати функцію, об'єкт чи клас без наслідування. |
There was a problem hiding this comment.
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 у тисячах компонентів і ми не знайшли жодного випадку використання в якому б ми могли порадити створення ієрархій наслідування компонентів. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comma , в якому
or , у якому
There was a problem hiding this 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Перекласти Welcome
@mihilbabin looks good, thank you for contribution :) |
Added translation for
Composition vs Inheritance
section.