Skip to content

Перевод главной страницы #19

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 5 commits into from
Feb 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/home/examples/a-component-using-external-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class MarkdownEditor extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.state = { value: 'Hello, **world**!' };
this.state = { value: 'Привет, **мир**!' };
}

handleChange(e) {
Expand All @@ -17,16 +17,16 @@ class MarkdownEditor extends React.Component {
render() {
return (
<div className="MarkdownEditor">
<h3>Input</h3>
<h3>Редактор</h3>
<label htmlFor="markdown-content">
Enter some markdown
Введите что-нибудь в формате Markdown
</label>
<textarea
id="markdown-content"
onChange={this.handleChange}
defaultValue={this.state.value}
/>
<h3>Output</h3>
<h3>Вывод</h3>
<div
className="content"
dangerouslySetInnerHTML={this.getRawMarkup()}
Expand Down
4 changes: 2 additions & 2 deletions content/home/examples/a-component-using-external-plugins.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: A Component Using External Plugins
title: Компонент с использованием внешних плагинов
order: 3
domid: markdown-example
---

React is flexible and provides hooks that allow you to interface with other libraries and frameworks. This example uses **remarkable**, an external Markdown library, to convert the `<textarea>`'s value in real time.
React — гибкий, поэтому в нём есть хуки, которые дают работать с другими библиотеками и фреймворками. В этом примере используется внешняя библиотека **remarkable**, чтобы в режиме реального времени преобразовать Markdown-синтаксис, введённый в элемент `<textarea>`.
4 changes: 2 additions & 2 deletions content/home/examples/a-simple-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ class HelloMessage extends React.Component {
render() {
return (
<div>
Hello {this.props.name}
Привет, {this.props.name}
</div>
);
}
}

ReactDOM.render(
<HelloMessage name="Taylor" />,
<HelloMessage name="Саша" />,
document.getElementById('hello-example')
);
6 changes: 3 additions & 3 deletions content/home/examples/a-simple-component.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: A Simple Component
title: Простой компонент
order: 0
domid: hello-example
---

React components implement a `render()` method that takes input data and returns what to display. This example uses an XML-like syntax called JSX. Input data that is passed into the component can be accessed by `render()` via `this.props`.
React-компоненты реализуют метод `render()`, который принимает входные данные и возвращает что-то для вывода. В этом примере используется XML-подобный синтаксис под названием JSX. Входные данные, передаваемые в компонент, доступны в `render()` через `this.props`.

**JSX is optional and not required to use React.** Try the [Babel REPL](babel://es5-syntax-example) to see the raw JavaScript code produced by the JSX compilation step.
**JSX является необязательным и не требуется React.** Попробуйте [Babel REPL](babel://es5-syntax-example), чтобы увидеть JavaScript-код, полученный на этапе компиляции JSX.
2 changes: 1 addition & 1 deletion content/home/examples/a-stateful-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Timer extends React.Component {
render() {
return (
<div>
Seconds: {this.state.seconds}
Секунды: {this.state.seconds}
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions content/home/examples/a-stateful-component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: A Stateful Component
title: Компонент с состоянием
order: 1
domid: timer-example
---

In addition to taking input data (accessed via `this.props`), a component can maintain internal state data (accessed via `this.state`). When a component's state data changes, the rendered markup will be updated by re-invoking `render()`.
Помимо ввода входных данных (доступных через `this.props`), компонент поддерживает внутренние данные состояния (доступные через `this.state`). Когда данные состояния компонента изменятся, React ещё раз вызовет `render()` и обновит отрендеренную разметку.
6 changes: 3 additions & 3 deletions content/home/examples/an-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ class TodoApp extends React.Component {
render() {
return (
<div>
<h3>TODO</h3>
<h3>Список дел</h3>
<TodoList items={this.state.items} />
<form onSubmit={this.handleSubmit}>
<label htmlFor="new-todo">
What needs to be done?
Что нужно сделать?
</label>
<input
id="new-todo"
onChange={this.handleChange}
value={this.state.text}
/>
<button>
Add #{this.state.items.length + 1}
Добавить #{this.state.items.length + 1}
</button>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions content/home/examples/an-application.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: An Application
title: Приложение
order: 2
domid: todos-example
---

Using `props` and `state`, we can put together a small Todo application. This example uses `state` to track the current list of items as well as the text that the user has entered. Although event handlers appear to be rendered inline, they will be collected and implemented using event delegation.
Используя `props` и `state`, можно создать небольшое приложение списка дел. В этом примере используется `state` для отслеживания текущего списка элементов, а также текста, введённого пользователем. Хотя обработчики событий встроены в разметку, они собираются и реализуются с помощью делегирования событий.
6 changes: 3 additions & 3 deletions content/home/marketing/component-based.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Component-Based
title: Основан на компонентах
order: 1
---

Build encapsulated components that manage their own state, then compose them to make complex UIs.
Создавайте инкапсулированные компоненты с собственным состоянием, а затем объединяйте их в сложные пользовательские интерфейсы.

Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
Поскольку логика компонента написана на JavaScript, а не содержится в шаблонах, можно с лёгкостью передавать самые разные данные по всему приложению и держать состояние вне DOM.
6 changes: 3 additions & 3 deletions content/home/marketing/declarative.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Declarative
title: Декларативный
order: 0
---

React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.
Создавать интерактивные пользовательские интерфейсы на React — приятно и просто. Вам достаточно описать, как части интерфейса приложения выглядят в разных состояниях. React будет своевременно их обновлять, когда данные изменяются.

Declarative views make your code more predictable and easier to debug.
Декларативные представления сделают код более предсказуемым и упростят отладку.
6 changes: 3 additions & 3 deletions content/home/marketing/learn-once-write-anywhere.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Learn Once, Write Anywhere
title: Научитесь однажды — пишите где угодно
order: 2
---

We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.
Нам не нужно ничего знать про остальную часть вашего технологического стека, поэтому вы можете разрабатывать новый функционал в React, не изменяя существующий код.

React can also render on the server using Node and power mobile apps using [React Native](https://facebook.github.io/react-native/).
React также может работать на Node.js, и даже на мобильных платформах с помощью [React Native](https://facebook.github.io/react-native/).