diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index 7eb71491c8d4..b1d06bcfd355 100644 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -1,38 +1,38 @@ -- title: Quick Start +- title: 快速上手 items: - id: getting-started - title: Getting Started + title: 入门教程 - id: tutorial - title: Tutorial + title: 教程 - id: thinking-in-react - title: Thinking in React -- title: Community Resources + title: 用 React 思考 +- title: 社区资源 items: - id: videos - title: Videos + title: 视频 - id: complementary-tools - title: Complementary Tools + title: 补充工具 - id: examples - title: Examples + title: 范例 - title: Guides items: - id: why-react - title: Why React? + title: 为什么使用 React? - id: displaying-data - title: Displaying Data + title: 显示数据 subitems: - id: jsx-in-depth - title: JSX in Depth + title: 深入 JSX - id: jsx-gotchas - title: JSX Gotchas + title: JSX 的误区 - id: interactivity-and-dynamic-uis title: Interactivity and Dynamic UIs - id: multiple-components title: Multiple Components - id: reusable-components - title: Reusable Components + title: 可复用组件 - id: forms - title: Forms + title: 表单 - id: working-with-the-browser title: Working With the Browser subitems: @@ -68,7 +68,7 @@ - id: component-specs title: Component Specs and Lifecycle - id: tags-and-attributes - title: Supported Tags and Attributes + title: 标签和属性支持 - id: events title: Event System - id: dom-differences diff --git a/docs/docs/01-why-react.md b/docs/docs/01-why-react.md index a11b49bd3993..7ba13c243ad9 100644 --- a/docs/docs/01-why-react.md +++ b/docs/docs/01-why-react.md @@ -1,29 +1,32 @@ --- id: why-react -title: Why React? +title: 为什么使用 React? permalink: why-react.html next: displaying-data.html --- -React is a JavaScript library for creating user interfaces by Facebook and Instagram. Many people choose to think of React as the **V** in **[MVC](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)**. -We built React to solve one problem: **building large applications with data that changes over time**. To do this, React uses two main ideas. +React 是一个 Facebook 和 Instagram 用来创建用户界面的 JavaScript 库。很人多认为 React 是 **[MVC](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)** 中的 **V**(视图)。 -### Simple +我们创造 React 是为了解决一个问题:**构建随着时间数据不断变化的大规模应用程序**。为了达到这个目标,React 采用下面两个主要的思想。 -Simply express how your app should look at any given point in time, and React will automatically manage all UI updates when your underlying data changes. +### 简单 -### Declarative +仅仅只要表达出你的应用程序在任一个时间点应该长的样子,然后当底层的数据变了,React 会自动处理所有用户界面的更新。 -When the data changes, React conceptually hits the "refresh" button, and knows to only update the changed parts. +### 声明式 (Declarative) -## Build Composable Components +当数据变化了,React 概念上是类似点击了更新的按钮,但仅会更新变化的部分。 -React is all about building reusable components. In fact, with React the *only* thing you do is build components. Since they're so encapsulated, components make code reuse, testing, and separation of concerns easy. +## 构建可组合的组件 -## Give It Five Minutes +React 都是关于构建可复用的组件。事实上,通过 React 你*唯一*要做的事情就是构建组件。得益于其良好的封装性,组件使代码复用、测试和关注分离(separation of concerns)更加简单。 -React challenges a lot of conventional wisdom, and at first glance some of the ideas may seem crazy. [Give it five minutes](http://37signals.com/svn/posts/3124-give-it-five-minutes) while reading this guide; those crazy ideas have worked for building thousands of components both inside and outside of Facebook and Instagram. +## 给它5分钟的时间 + +React挑战了很多传统的知识,第一眼看上去可能很多想法有点疯狂。当你阅读这篇指南,请[给它5分钟的时间](http://37signals.com/svn/posts/3124-give-it-five-minutes);那些疯狂的想法已经帮助 Facebook 和 Instagram 从里到外创建了上千的组件了。 + +## 了解更多 + +你可以从这篇[博客](http://facebook.github.io/react/blog/2013/06/05/why-react.html)了解更多我们创造 React 的动机。 -## Learn More -You can learn more about our motivations behind building React in [this blog post](http://facebook.github.io/react/blog/2013/06/05/why-react.html). diff --git a/docs/docs/01-why-react.zh-CN.md b/docs/docs/01-why-react.zh-CN.md deleted file mode 100644 index 2fda63279379..000000000000 --- a/docs/docs/01-why-react.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: why-react-zh-CN -title: 为什么使用 React? -permalink: why-react-zh-CN.html -next: displaying-data-zh-CN.html ---- - -React 是一个 Facebook 和 Instagram 用来创建用户界面的 JavaScript 库。很人多认为 React 是 **[MVC](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)** 中的 **V**(视图)。 - -我们创造 React 是为了解决一个问题:**构建随着时间数据不断变化的大规模应用程序**。为了达到这个目标,React 采用下面两个主要的思想。 - -### 简单 - -仅仅只要表达出你的应用程序在任一个时间点应该长的样子,然后当底层的数据变了,React 会自动处理所有用户界面的更新。 - -### 表达能力 (Declarative) - -当数据变化了,React 概念上是类似点击了更新的按钮,但仅会更新变化的部分。 - -## 构建可组合的组件 - -React 都是关于构建可复用的组件。事实上,通过 React 你*唯一*要做的事情就是构建组件。得益于其良好的封装性,组件使代码复用、测试和关注分离(separation of concerns)更加简单。 - -## 给它5分钟的时间 - -React挑战了很多传统的知识,第一眼看上去可能很多想法有点疯狂。当你阅读这篇指南,请[给它5分钟的时间](http://37signals.com/svn/posts/3124-give-it-five-minutes);那些疯狂的想法已经帮助 Facebook 和 Instagram 从里到外创建了上千的组件了。 - -## 了解更多 - -你可以从这篇[博客](http://facebook.github.io/react/blog/2013/06/05/why-react.html)了解更多我们创造 React 的动机。 - - diff --git a/docs/docs/02-displaying-data.md b/docs/docs/02-displaying-data.md index d101a6d90817..71a6d0cabcb4 100644 --- a/docs/docs/02-displaying-data.md +++ b/docs/docs/02-displaying-data.md @@ -1,17 +1,17 @@ --- id: displaying-data -title: Displaying Data +title: 显示数据 +layout: docs permalink: displaying-data.html prev: why-react.html next: jsx-in-depth.html --- -The most basic thing you can do with a UI is display some data. React makes it easy to display data and automatically keeps the interface up-to-date when the data changes. +通过用户界面,最基础可以做的事就是显示一些数据。React 让显示数据变得简单,当数据变化的时候,用户界面会自动同步更新。 +## 开始 -## Getting Started - -Let's look at a really simple example. Create a `hello-react.html` file with the following code: +让我们看一个非常简单的例子。新建一个名为 `hello-react.html` 的文件,代码内容如下: ```html @@ -25,14 +25,14 @@ Let's look at a really simple example. Create a `hello-react.html` file with the