Skip to content

Commit 946bd51

Browse files
committed
Resolve merge conflicts.
Resolve merge conflicts. Пока остаются места с английским текстом.
1 parent 9cb0e02 commit 946bd51

40 files changed

+93
-592
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,10 @@
77
### Предварительные требования
88

99
1. Git
10-
<<<<<<< HEAD
1110
1. Node: любая версия 12.x, начиная с 12.0.0 или выше
12-
1. Yarn: Посмотрите [сайт Yarn с инструкциями по установке](https://yarnpkg.com/lang/en/docs/install/)
11+
1. Yarn v1: Посмотрите [сайт Yarn с инструкциями по установке](https://yarnpkg.com/lang/en/docs/install/)
1312
1. Сделать форк этого репозитория (для предложения изменений)
1413
1. Копия [репозитория ru.reactjs.org](https://github.com/reactjs/ru.reactjs.org) на вашем компьютере
15-
=======
16-
1. Node: any 12.x version starting with v12.0.0 or greater
17-
1. Yarn v1: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
18-
1. A fork of the repo (for any contributions)
19-
1. A clone of the [reactjs.org repo](https://github.com/reactjs/reactjs.org) on your local machine
20-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
2114

2215
### Установка
2316

content/blog/2022-03-08-react-18-upgrade-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Finally, this API will continue to work for rendering e-mails:
125125

126126
For more information on the changes to server rendering APIs, see the working group post on [Upgrading to React 18 on the server](https://github.com/reactwg/react-18/discussions/22), a [deep dive on the new Suspense SSR Architecture](https://github.com/reactwg/react-18/discussions/37), and [Shaundai Person’s](https://twitter.com/shaundai) talk on [Streaming Server Rendering with Suspense](https://www.youtube.com/watch?v=pj5N-Khihgc) at React Conf 2021.
127127

128-
## Updates to TypeScript definitions
128+
## Updates to TypeScript definitions {#updates-to-typescript-definitions}
129129

130130
If your project uses TypeScript, you will need to update your `@types/react` and `@types/react-dom` dependencies to the latest versions. The new types are safer and catch issues that used to be ignored by the type checker. The most notable change is that the `children` prop now needs to be listed explicitly when defining props, for example:
131131

content/docs/accessibility.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,7 @@ class BlurExample extends React.Component {
401401
- [всё о цветовой контрастности и о том, почему вы должны переосмыслить подход к ней](https://www.smashingmagazine.com/2014/10/color-contrast-tips-and-tools-for-accessibility/)
402402
- [статья о цветовой контрастности на сайте A11y Project](https://a11yproject.com/posts/what-is-color-contrast/)
403403

404-
<<<<<<< HEAD
405-
Ручной расчёт правильных цветовых комбинаций для всех вариантов сайта может быть очень утомительным. Вместо этого вы можете рассчитать все необходимые палитры [с помощью Colorable](https://jxnblk.com/colorable/).
406-
=======
407-
It can be tedious to manually calculate the proper color combinations for all cases in your website so instead, you can [calculate an entire accessible color palette with Colorable](https://colorable.jxnblk.com/).
408-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
404+
Ручной расчёт правильных цветовых комбинаций для всех вариантов сайта может быть очень утомительным. Вместо этого вы можете рассчитать все необходимые палитры [с помощью Colorable](https://colorable.jxnblk.com/).
409405

410406
Оба инструмента, aXe и WAVE, о которых будет рассказано ниже, включают тесты контрастности. Они помогут выявить ошибки в подборе цветов.
411407

content/docs/add-react-to-a-website.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ next: create-a-new-react-app.html
2525

2626
Мы не будем пользоваться сложными инструментами сборки или что-то устанавливать. **Всё, что вам нужно -- это доступ к Интернету и минута свободного времени**.
2727

28-
<<<<<<< HEAD
29-
Необязательно: [скачать готовый пример (архив 2 Кбайт)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/f6c882b6ae18bde42dcf6fdb751aae93495a2275.zip)
30-
=======
31-
Optional: [Download the full example (2KB zipped)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/87f0b6f34238595b44308acfb86df6ea43669c08.zip)
32-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
28+
Необязательно: [скачать готовый пример (архив 2 Кбайт)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/87f0b6f34238595b44308acfb86df6ea43669c08.zip)
3329

3430
### Шаг 1: Добавляем DOM-контейнер в HTML {#step-1-add-a-dom-container-to-the-html}
3531

@@ -56,17 +52,10 @@ Optional: [Download the full example (2KB zipped)](https://gist.github.com/gaear
5652
```html{5,6,9}
5753
<!-- ... остальной HTML ... -->
5854
59-
<<<<<<< HEAD
6055
<!-- Загрузим React. -->
6156
<!-- Примечание: при деплое на продакшен замените «development.js» на «production.min.js». -->
62-
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
63-
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
64-
=======
65-
<!-- Load React. -->
66-
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
6757
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
6858
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
69-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
7059
7160
<!-- Загрузим наш React-компонент. -->
7261
<script src="like_button.js"></script>
@@ -86,28 +75,17 @@ Optional: [Download the full example (2KB zipped)](https://gist.github.com/gaear
8675
>
8776
>В данном коде создаётся React-компонент с именем `LikeButton`. Не беспокойтесь, если что-то кажется вам непонятным -- мы подробно разберём принципы разработки на React позже, в нашем [практическом руководстве](/tutorial/tutorial.html) и во [введении в основные понятия](/docs/hello-world.html). Пока же мы просто посмотрим, как это выглядит на экране.
8877
89-
<<<<<<< HEAD
90-
Добавьте ещё 2 строки в конец файла `like_button.js`, после **[стартового кода](https://gist.github.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)**:
91-
92-
```js{3,4}
93-
// ... стартовый код ...
94-
=======
95-
After **[the starter code](https://gist.github.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)**, add three lines to the bottom of `like_button.js`:
78+
Добавьте ещё 3 строки в конец файла `like_button.js`, после **[стартового кода](https://gist.github.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)**:
9679

9780
```js{3,4,5}
98-
// ... the starter code you pasted ...
99-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
81+
// ... стартовый код ...
10082
10183
const domContainer = document.querySelector('#like_button_container');
10284
const root = ReactDOM.createRoot(domContainer);
10385
root.render(e(LikeButton));
10486
```
10587

106-
<<<<<<< HEAD
107-
Эти две строки кода ищут элемент `<div>`, который мы добавили на первом шаге, а затем отображают React-компонент с кнопкой "Нравится" внутри него.
108-
=======
109-
These three lines of code find the `<div>` we added to our HTML in the first step, create a React app with it, and then display our "Like" button React component inside of it.
110-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
88+
Эти три строки кода ищут элемент `<div>`, который мы добавили в HTML на первом шаге, а затем отображают React-компонент с кнопкой "Нравится" внутри него.
11189

11290
### Готово! {#thats-it}
11391

@@ -117,23 +95,15 @@ These three lines of code find the `<div>` we added to our HTML in the first ste
11795

11896
**[Посмотреть финальный код примера](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605)**
11997

120-
<<<<<<< HEAD
121-
**[Скачать код примера (архив 2 Кбайт)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/f6c882b6ae18bde42dcf6fdb751aae93495a2275.zip)**
122-
=======
123-
**[Download the full example (2KB zipped)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/87f0b6f34238595b44308acfb86df6ea43669c08.zip)**
124-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
98+
**[Скачать код примера (архив 2 Кбайт)](https://gist.github.com/gaearon/6668a1f6986742109c00a581ce704605/archive/87f0b6f34238595b44308acfb86df6ea43669c08.zip)**
12599

126100
### Совет: Повторное использование компонентов {#tip-reuse-a-component}
127101

128102
Зачастую, вам может понадобиться отобразить React-компонент в нескольких местах одной и той же HTML-страницы. Вот как можно показать сразу три кнопки «Нравится» с разными данными:
129103

130104
[Посмотреть исходный код примера](https://gist.github.com/gaearon/faa67b76a6c47adbab04f739cba7ceda)
131105

132-
<<<<<<< HEAD
133-
[Скачать код примера (архив 2 Кбайт)](https://gist.github.com/gaearon/faa67b76a6c47adbab04f739cba7ceda/archive/9d0dd0ee941fea05fd1357502e5aa348abb84c12.zip)
134-
=======
135-
[Download the full example (2KB zipped)](https://gist.github.com/gaearon/faa67b76a6c47adbab04f739cba7ceda/archive/279839cb9891bd41802ebebc5365e9dec08eeb9f.zip)
136-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
106+
[Скачать код примера (архив 2 Кбайт)](https://gist.github.com/gaearon/faa67b76a6c47adbab04f739cba7ceda/archive/279839cb9891bd41802ebebc5365e9dec08eeb9f.zip)
137107

138108
>Примечание
139109
>

content/docs/addons-shallow-renderer.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ expect(result.props.children).toEqual([
5959

6060
Вы можете думать о shallowRenderer как о «месте» в которое рендерится тестируемый компонент, и из которого вы можете извлечь результат вывода этого компонента.
6161

62-
<<<<<<< HEAD
63-
`shallowRenderer.render()` схож с [`ReactDOM.render()`](/docs/react-dom.html#render), но не требует DOM и рендерит всего один уровень глубины. Это означает что вы можете тестировать компоненты независимо от того, как реализованы их дочерние компоненты.
64-
=======
65-
`shallowRenderer.render()` is similar to [`root.render()`](/docs/react-dom-client.html#createroot) but it doesn't require DOM and only renders a single level deep. This means you can test components isolated from how their children are implemented.
66-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
62+
`shallowRenderer.render()` схож с [`root.render()`](/docs/react-dom-client.html#createroot), но не требует DOM и рендерит всего один уровень глубины. Это означает что вы можете тестировать компоненты независимо от того, как реализованы их дочерние компоненты.
6763

6864
### `shallowRenderer.getRenderOutput()` {#shallowrenderergetrenderoutput}
6965

content/docs/cdn-links.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ next: release-channels.html
2020
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
2121
```
2222

23-
<<<<<<< HEAD
24-
Для загрузки конкретной версии `react` и `react-dom`, замените `17` на номер нужной версии.
25-
=======
26-
To load a specific version of `react` and `react-dom`, replace `18` with the version number.
27-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
23+
Для загрузки конкретной версии `react` и `react-dom`, замените `18` на номер нужной версии.
2824

2925
### Зачем нужен атрибут `crossorigin`? {#why-the-crossorigin-attribute}
3026

content/docs/code-splitting.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ import("./math").then(math => {
8282

8383
## `React.lazy` {#reactlazy}
8484

85-
<<<<<<< HEAD
86-
> Примечание:
87-
>
88-
> Возможности `React.lazy` и задержки (suspense) пока недоступны для рендеринга на стороне сервера. Если вам нужно разделение кода в серверном приложении, мы рекомендуем [Loadable Components](https://github.com/gregberge/loadable-components). У них есть хорошее [руководство по разделению бандла](https://loadable-components.com/docs/server-side-rendering/) с серверным рендерингом.
89-
9085
Функция `React.lazy` позволяет рендерить динамический импорт как обычный компонент.
91-
=======
92-
The `React.lazy` function lets you render a dynamic import as a regular component.
93-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
9486

9587
**До:**
9688

@@ -150,9 +142,6 @@ function MyComponent() {
150142
}
151143
```
152144

153-
<<<<<<< HEAD
154-
### Предохранители {#error-boundaries}
155-
=======
156145
### Avoiding fallbacks {#avoiding-fallbacks}
157146
Any component may suspend as a result of rendering, even components that were already shown to the user. In order for screen content to always be consistent, if an already shown component suspends, React has to hide its tree up to the closest `<Suspense>` boundary. However, from the user's perspective, this can be disorienting.
158147

@@ -199,9 +188,7 @@ function handleTabSelect(tab) {
199188

200189
Here, you tell React that setting tab to `'comments'` is not an urgent update, but is a [transition](/docs/react-api.html#transitions) that may take some time. React will then keep the old UI in place and interactive, and will switch to showing `<Comments />` when it is ready. See [Transitions](/docs/react-api.html#transitions) for more info.
201190

202-
### Error boundaries {#error-boundaries}
203-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
204-
191+
### Предохранители {#error-boundaries}
205192

206193
Если какой-то модуль не загружается (например, из-за сбоя сети), это вызовет ошибку. Вы можете обрабатывать эти ошибки для улучшения пользовательского опыта с помощью [Предохранителей](/docs/error-boundaries.html). После создания предохранителя, его можно использовать в любом месте над ленивыми компонентами для отображения состояния ошибки.
207194

content/docs/components-and-props.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,19 @@ function Welcome(props) {
6969
return <h1>Привет, {props.name}</h1>;
7070
}
7171
72-
<<<<<<< HEAD
73-
const element = <Welcome name="Алиса" />;
74-
ReactDOM.render(
75-
element,
76-
document.getElementById('root')
77-
);
78-
=======
7972
const root = ReactDOM.createRoot(document.getElementById('root'));
80-
const element = <Welcome name="Sara" />;
73+
const element = <Welcome name="Алиса" />;
8174
root.render(element);
82-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
8375
```
8476

8577
**[Try it on CodePen](https://codepen.io/gaearon/pen/YGYmEG?editors=1010)**
8678

8779
Давайте разберём, что именно здесь происходит:
8880

89-
<<<<<<< HEAD
90-
1. Мы передаём React-элемент `<Welcome name="Алиса" />` в `ReactDOM.render()`.
81+
1. Мы вызываем `root.render()` c React-элементом `<Welcome name="Алиса" />`.
9182
2. React вызывает наш компонент `Welcome` с пропсами `{name: 'Алиса'}`.
9283
3. Наш компонент `Welcome` возвращает элемент `<h1>Привет, Алиса</h1>` в качестве результата.
9384
4. React DOM делает минимальные изменения в DOM, чтобы получилось `<h1>Привет, Алиса</h1>`.
94-
=======
95-
1. We call `root.render()` with the `<Welcome name="Sara" />` element.
96-
2. React calls the `Welcome` component with `{name: 'Sara'}` as the props.
97-
3. Our `Welcome` component returns a `<h1>Hello, Sara</h1>` element as the result.
98-
4. React DOM efficiently updates the DOM to match `<h1>Hello, Sara</h1>`.
99-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
10085

10186
>**Примечание:** Всегда называйте компоненты с заглавной буквы.
10287
>

content/docs/conditional-rendering.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,9 @@ function Greeting(props) {
3535
return <GuestGreeting />;
3636
}
3737
38-
<<<<<<< HEAD
39-
ReactDOM.render(
40-
// Попробуйте заменить на isLoggedIn={true} и посмотрите на эффект.
41-
<Greeting isLoggedIn={false} />,
42-
document.getElementById('root')
43-
);
44-
=======
4538
const root = ReactDOM.createRoot(document.getElementById('root'));
46-
// Try changing to isLoggedIn={true}:
39+
// Попробуйте заменить на isLoggedIn={true}:
4740
root.render(<Greeting isLoggedIn={false} />);
48-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
4941
```
5042

5143
[**Посмотреть на CodePen**](https://codepen.io/gaearon/pen/ZpVxNq?editors=0011)

content/docs/error-boundaries.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ class ErrorBoundary extends React.Component {
6565

6666
## Живой пример {#live-demo}
6767

68-
<<<<<<< HEAD
69-
Посмотрите [пример объявления и использования предохранителя](https://codepen.io/gaearon/pen/wqvxGa?editors=0010) в [React 16](/blog/2017/09/26/react-v16.0.html).
70-
=======
71-
Check out [this example of declaring and using an error boundary](https://codepen.io/gaearon/pen/wqvxGa?editors=0010).
72-
>>>>>>> 26caa649827e8f8cadd24dfc420ea802dcbee246
68+
Посмотрите [пример объявления и использования предохранителя](https://codepen.io/gaearon/pen/wqvxGa?editors=0010).
7369

7470
## Где размещать предохранители {#where-to-place-error-boundaries}
7571

0 commit comments

Comments
 (0)