Skip to content

Commit 8d47388

Browse files
authored
Merge pull request #8 from reactjs/master
update
2 parents b3325f2 + 0b09854 commit 8d47388

File tree

93 files changed

+2019
-1954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2019
-1954
lines changed

TRANSLATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object).
175175
| bind | привязка |
176176
| bug | баг, дефект |
177177
| bundler | бандлер |
178+
| cache | кеш |
178179
| callback | колбэк |
179180
| camelCase | *camelCase* |
180181
| child | дочерний |
@@ -185,7 +186,7 @@ React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object).
185186
| codemod | codemod-скрипт |
186187
| commit | фиксация |
187188
| context | контекст |
188-
| (un)controlled component | (не)контролируемый компонент |
189+
| (un)controlled component | (не)управляемый компонент |
189190
| cross-cutting concerns | cквозная функциональность |
190191
| custom | пользовательский (*напр., пользовательские хуки*) |
191192
| debugging | отладка |

content/404.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: single
3-
title: Page Not Found
3+
title: Страница не найдена
44
permalink: 404.html
55
---
66

7-
We couldn't find what you were looking for.
7+
Мы не смогли найти то, что вы искали.
88

9-
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
9+
Пожалуйста, свяжитесь с владельцем сайта, с которого вы перешли по URL адресу, и дайте знать о сломанной ссылке.

content/blog/2019-02-23-is-react-translated-yet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ We started of with an initial trial period of three languages: Spanish, Japanese
4343

4444
After the trial period, we were ready to accept more languages. I created [a script](https://github.com/reactjs/reactjs.org-translation/blob/master/scripts/create.js) to automate the creation of the new language repo, and a site, [Is React Translated Yet?](https://isreacttranslatedyet.com), to track progress on the different translations. We started *10* new translations on our first day alone!
4545

46-
Because of the automation, the rest of the maintance went mostly smoothly. We eventually created a [Slack channel](https://rt-slack-invite.herokuapp.com) to make it easier for translators to share information, and I released a guide solidifying the [responsibilities of maintainers](https://github.com/reactjs/reactjs.org-translation/blob/master/maintainer-guide.md). Allowing translators to talk with each other was a great boon -- for example, the Arabic, Persian, and Hebrew translations were able to talk to each other in order to get [right-to-left text](https://en.wikipedia.org/wiki/Right-to-left) working!
46+
Because of the automation, the rest of the maintenance went mostly smoothly. We eventually created a [Slack channel](https://rt-slack-invite.herokuapp.com) to make it easier for translators to share information, and I released a guide solidifying the [responsibilities of maintainers](https://github.com/reactjs/reactjs.org-translation/blob/master/maintainer-guide.md). Allowing translators to talk with each other was a great boon -- for example, the Arabic, Persian, and Hebrew translations were able to talk to each other in order to get [right-to-left text](https://en.wikipedia.org/wiki/Right-to-left) working!
4747

4848
## The Bot {#the-bot}
4949

content/community/conferences.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1212

1313
## Upcoming Conferences {#upcoming-conferences}
1414

15-
### React Iran 2019 {#react-iran-2019}
16-
January 31, 2019 in Tehran, Iran
17-
[Website](http://reactiran.com) - [Instagram](https://www.instagram.com/reactiran/)
18-
1915
### Reactathon 2019 {#reactathon-2019}
2016
March 30-31, 2019 in San Francisco, USA
2117

@@ -31,6 +27,11 @@ April 12, 2019 in Amsterdam, The Netherlands
3127

3228
[Website](https://react.amsterdam) - [Twitter](https://twitter.com/reactamsterdam) - [Facebook](https://www.facebook.com/reactamsterdam)
3329

30+
### ReactJS Girls Conference
31+
May 3, 2019 in London, UK
32+
33+
[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)
34+
3435
### ReactEurope 2019 {#reacteurope-2019}
3536
May 23-24, 2019 in Paris, France
3637

@@ -343,3 +344,8 @@ November 4 in Tel Aviv, Israel
343344
November 30, Berlin, Germany
344345

345346
[Website](https://reactday.berlin) - [Twitter](https://twitter.com/reactdayberlin) - [Facebook](https://www.facebook.com/reactdayberlin/) - [Videos](https://www.youtube.com/channel/UC1EYHmQYBUJjkmL6OtK4rlw)
347+
348+
### React Iran 2019 {#react-iran-2019}
349+
January 31, 2019 in Tehran, Iran
350+
351+
[Website](http://reactiran.com) - [Instagram](https://www.instagram.com/reactiran/)

content/docs/accessibility.md

Lines changed: 157 additions & 176 deletions
Large diffs are not rendered by default.

content/docs/addons-test-utils.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 с npm
1515

1616
## Обзор {#overview}
1717

18-
`ReactTestUtils` позволяет легко тестировать React-компоненты в любом тестовом фреймворке на ваш выбор. В Facebook мы используем [Jest](https://facebook.github.io/jest/) для гладкого тестирования JavaScript-кода. Если хотите обучится Jest, ознакомьтесь с [руководством по React](https://jestjs.io/docs/en/tutorial-react).
18+
`ReactTestUtils` позволяет легко тестировать React-компоненты в любом тестовом фреймворке на ваш выбор. В Facebook мы используем [Jest](https://facebook.github.io/jest/) для гладкого тестирования JavaScript-кода. Если хотите обучиться Jest, ознакомьтесь с [руководством по React](https://jestjs.io/docs/en/tutorial-react).
1919

2020
> Примечание:
2121
>
@@ -53,7 +53,7 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 с npm
5353
Допустим, у нас есть компонент `Counter`:
5454

5555
```js
56-
class App extends React.Component {
56+
class Counter extends React.Component {
5757
constructor(props) {
5858
super(props);
5959
this.state = {count: 0};
@@ -103,7 +103,7 @@ afterEach(() => {
103103
container = null;
104104
});
105105
106-
it('рендер и обновление счетчика', () => {
106+
it('рендер и обновление счётчика', () => {
107107
// Тестируем первый рендер и метод componentDidMount
108108
act(() => {
109109
ReactDOM.render(<Counter />, container);
@@ -139,7 +139,7 @@ mockComponent(
139139

140140
> Примечание:
141141
>
142-
> API-метод `mockComponent()` объявлен устаревшим. Поэтому вместо него рекомендуется использоваться [поверхностный рендеринг](/docs/shallow-renderer.html) или [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock).
142+
> API-метод `mockComponent()` объявлен устаревшим. Поэтому вместо него рекомендуется использовать [поверхностный рендеринг](/docs/shallow-renderer.html) или [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock).
143143
144144
* * *
145145

@@ -221,7 +221,7 @@ scryRenderedDOMComponentsWithClass(
221221
)
222222
```
223223

224-
Находит все DOM-элементы компонентов в отображаемом дереве, которые являются DOM-компонентами с сопоставлением имен классов `className`.
224+
Находит все DOM-элементы компонентов в отображаемом дереве, которые являются DOM-компонентами с сопоставлением имён классов `className`.
225225

226226
* * *
227227

@@ -247,7 +247,7 @@ scryRenderedDOMComponentsWithTag(
247247
)
248248
```
249249

250-
Ищет все DOM-элементы компонентов в отображенном дереве, которые являются DOM-компонентами, и имя которых соответствует `tagName`.
250+
Ищет все DOM-элементы компонентов в отображённом дереве, которые являются DOM-компонентами, и имя которых соответствует `tagName`.
251251

252252
* * *
253253

content/docs/code-splitting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ import("./math").then(math => {
102102
103103
When Webpack comes across this syntax, it automatically starts code-splitting
104104
your app. If you're using Create React App, this is already configured for you
105-
and you can [start using it](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting) immediately. It's also supported
105+
and you can [start using it](https://facebook.github.io/create-react-app/docs/code-splitting) immediately. It's also supported
106106
out of the box in [Next.js](https://github.com/zeit/next.js/#dynamic-import).
107107

108108
If you're setting up Webpack yourself, you'll probably want to read Webpack's

content/docs/components-and-props.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ next: state-and-lifecycle.html
2626

2727
```js
2828
function Welcome(props) {
29-
return <h1>Hello, {props.name}</h1>;
29+
return <h1>Привет, {props.name}</h1>;
3030
}
3131
```
3232

@@ -37,7 +37,7 @@ function Welcome(props) {
3737
```js
3838
class Welcome extends React.Component {
3939
render() {
40-
return <h1>Hello, {this.props.name}</h1>;
40+
return <h1>Привет, {this.props.name}</h1>;
4141
}
4242
}
4343
```
@@ -99,7 +99,7 @@ ReactDOM.render(
9999

100100
```js{8-10}
101101
function Welcome(props) {
102-
return <h1>Hello, {props.name}</h1>;
102+
return <h1>Привет, {props.name}</h1>;
103103
}
104104
105105
function App() {

content/docs/composition-vs-inheritance.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
id: composition-vs-inheritance
3-
title: Composition vs Inheritance
3+
title: Композиция против наследования
44
permalink: docs/composition-vs-inheritance.html
55
redirect_from:
66
- "docs/multiple-components.html"
77
prev: lifting-state-up.html
88
next: thinking-in-react.html
99
---
1010

11-
React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.
11+
React имеет мощную модель композиции, поэтому для переиспользования кода между компонентами мы рекомендуем использовать композицию вместо наследования.
1212

13-
In this section, we will consider a few problems where developers new to React often reach for inheritance, and show how we can solve them with composition.
13+
В этой главе мы рассмотрим несколько проблем, которые новички в React решают наследованием и попробуем решить их с помощью композиции.
1414

15-
## Containment {#containment}
15+
## Вставка {#containment}
1616

17-
Some components don't know their children ahead of time. This is especially common for components like `Sidebar` or `Dialog` that represent generic "boxes".
17+
Некоторые компоненты не знают своих потомков заранее. Это особенно характерно для таких компонентов, как `Sidebar` или `Dialog`, которые представляют из себя как бы «коробку», в которую можно что-то положить.
1818

19-
We recommend that such components use the special `children` prop to pass children elements directly into their output:
19+
Для таких компонентов мы рекомендуем использовать специальный проп `children`, который передаст дочерние элементы сразу на вывод:
2020

2121
```js{4}
2222
function FancyBorder(props) {
@@ -28,28 +28,28 @@ function FancyBorder(props) {
2828
}
2929
```
3030

31-
This lets other components pass arbitrary children to them by nesting the JSX:
31+
Это позволит передать компоненту произвольные дочерние элементы, вложив их в JSX:
3232

3333
```js{4-9}
3434
function WelcomeDialog() {
3535
return (
3636
<FancyBorder color="blue">
3737
<h1 className="Dialog-title">
38-
Welcome
38+
Добро пожаловать
3939
</h1>
4040
<p className="Dialog-message">
41-
Thank you for visiting our spacecraft!
41+
Спасибо, что посетили наш космический корабль!
4242
</p>
4343
</FancyBorder>
4444
);
4545
}
4646
```
4747

48-
**[Try it on CodePen](https://codepen.io/gaearon/pen/ozqNOV?editors=0010)**
48+
**[Посмотреть на CodePen](https://codepen.io/gaearon/pen/ozqNOV?editors=0010)**
4949

50-
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.
50+
Всё, что находится внутри JSX-тега `<FancyBorder>`, передаётся в компонент `FancyBorder` через проп `children`. Поскольку `FancyBorder` рендерит `{props.children}` внутри `<div>`, все переданные элементы отображаются в конечном выводе.
5151

52-
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`:
52+
Иногда в компоненте необходимо иметь несколько мест для вставки. В таком случае можно придумать свой формат, а не использовать `children`:
5353

5454
```js{5,8,18,21}
5555
function SplitPane(props) {
@@ -78,15 +78,15 @@ function App() {
7878
}
7979
```
8080

81-
[**Try it on CodePen**](https://codepen.io/gaearon/pen/gwZOJp?editors=0010)
81+
[**Посмотреть на CodePen**](https://codepen.io/gaearon/pen/gwZOJp?editors=0010)
8282

83-
React elements like `<Contacts />` and `<Chat />` are just objects, so you can pass them as props like any other data. This approach may remind you of "slots" in other libraries but there are no limitations on what you can pass as props in React.
83+
Такие React-элементы, как `<Contacts />` и `<Chat />` являются просто объектами, поэтому их можно передать в виде пропсов, как и любые другие данные. Этот подход может напоминать понятие «слотов» в других библиотеках, однако, в React нет никаких ограничений на то, что можно передать в качестве пропсов.
8484

85-
## Specialization {#specialization}
85+
## Специализация {#specialization}
8686

87-
Sometimes we think about components as being "special cases" of other components. For example, we might say that a `WelcomeDialog` is a special case of `Dialog`.
87+
Некоторые компоненты можно рассматривать как «частные случаи» других компонентов. Например, `WelcomeDialog` может быть частным случаем `Dialog`.
8888

89-
In React, this is also achieved by composition, where a more "specific" component renders a more "generic" one and configures it with props:
89+
В React это можно сделать через композицию, где «частный» вариант компонента рендерит более «общий» и настраивает его с помощью пропсов:
9090

9191
```js{5,8,16-18}
9292
function Dialog(props) {
@@ -105,15 +105,15 @@ function Dialog(props) {
105105
function WelcomeDialog() {
106106
return (
107107
<Dialog
108-
title="Welcome"
109-
message="Thank you for visiting our spacecraft!" />
108+
title="Добро пожаловать"
109+
message="Спасибо, что посетили наш космический корабль!" />
110110
);
111111
}
112112
```
113113

114-
[**Try it on CodePen**](https://codepen.io/gaearon/pen/kkEaOZ?editors=0010)
114+
[**Посмотреть на CodePen**](https://codepen.io/gaearon/pen/kkEaOZ?editors=0010)
115115

116-
Composition works equally well for components defined as classes:
116+
Композиция хорошо работает и для компонентов, определённых через классы:
117117

118118
```js{10,27-31}
119119
function Dialog(props) {
@@ -140,12 +140,12 @@ class SignUpDialog extends React.Component {
140140
141141
render() {
142142
return (
143-
<Dialog title="Mars Exploration Program"
144-
message="How should we refer to you?">
143+
<Dialog title="Программа исследования Марса"
144+
message="Как к вам обращаться?">
145145
<input value={this.state.login}
146146
onChange={this.handleChange} />
147147
<button onClick={this.handleSignUp}>
148-
Sign Me Up!
148+
Запишите меня!
149149
</button>
150150
</Dialog>
151151
);
@@ -156,17 +156,17 @@ class SignUpDialog extends React.Component {
156156
}
157157
158158
handleSignUp() {
159-
alert(`Welcome aboard, ${this.state.login}!`);
159+
alert(`Добро пожаловать на борт, ${this.state.login}!`);
160160
}
161161
}
162162
```
163163

164-
[**Try it on CodePen**](https://codepen.io/gaearon/pen/gwZbYa?editors=0010)
164+
[**Посмотреть на CodePen**](https://codepen.io/gaearon/pen/gwZbYa?editors=0010)
165165

166-
## So What About Inheritance? {#so-what-about-inheritance}
166+
## Так что насчёт наследования? {#so-what-about-inheritance}
167167

168-
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.
168+
В Facebook мы используем React в тысячах компонентов, и не находили случаев, когда бы рекомендовали создавать иерархии наследования компонентов.
169169

170-
Props and composition give you all the flexibility you need to customize a component's look and behavior in an explicit and safe way. Remember that components may accept arbitrary props, including primitive values, React elements, or functions.
170+
Пропсы и композиция дают вам всю гибкость, необходимую для настройки внешнего вида и поведения компонента явным и безопасным способом. Помните, что компоненты могут принимать произвольные пропсы, включая примитивные значения, React-элементы или функции.
171171

172-
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.
172+
Если вы хотите переиспользовать не связанную с внешним видом функциональность между компонентами, извлеките её в отдельный JavaScript-модуль. Импортируйте его в компонент и используйте эту функцию, объект или класс, не расширяя их.

0 commit comments

Comments
 (0)