You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page is an overview of the React documentation and related resources.
21
+
这是一个 React 文档及相关资源的概览页面。
22
22
23
-
**React**is a JavaScript library for building user interfaces. Learn what React is all about on [our homepage](/)or [in the tutorial](/tutorial/tutorial.html).
React has been designed from the start for gradual adoption, and **you can use as little or as much React as you need.** Whether you want to get a taste of React, add some interactivity to a simple HTML page, or start a complex React-powered app, the links in this section will help you get started.
35
+
React 从诞生之初就是可被逐步采用的,因而**你可以按需引入或多或少的 React 特性**。不管你是想体验下 React,用它给简单的 HTML 页面增加一点交互,还是要开始一个完全由 React 驱动的复杂应用,该章节内容里的链接都能帮你快速开始。
36
36
37
-
### Online Playgrounds {#online-playgrounds}
37
+
### 在线体验 {#online-playgrounds}
38
38
39
-
If you're interested in playing around with React, you can use an online code playground. Try a Hello World template on [CodePen](codepen://hello-world)or[CodeSandbox](https://codesandbox.io/s/new).
39
+
如果你对体验 React 感兴趣,可以尝试在线代码编辑器。从 [CodePen](codepen://hello-world)或[CodeSandbox](https://codesandbox.io/s/new) 开始一个 React 版本的 Hello World 模版。
40
40
41
-
If you prefer to use your own text editor, you can also [download this HTML file](https://raw.githubusercontent.com/reactjs/reactjs.org/master/static/html/single-file-example.html), edit it, and open it from the local filesystem in your browser. It does a slow runtime code transformation, so we'd only recommend using this for simple demos.
41
+
如果你喜欢使用自己的文本编辑器,也可以 [下载这个 HTML 文件](https://raw.githubusercontent.com/reactjs/reactjs.org/master/static/html/single-file-example.html),然后编辑文件内容,最后再用浏览器从本地文件系统打开文件,预览页面效果。注意:这个文件中包含一个低效率的运行时代码转换脚本,所以我们推荐仅在简单的演示项目中使用。
42
42
43
-
### Add React to a Website {#add-react-to-a-website}
43
+
### 在网站中添加 React {#add-react-to-a-website}
44
44
45
-
You can [add React to an HTML page in one minute](/docs/add-react-to-a-website.html). You can then either gradually expand its presence, or keep it contained to a few dynamic widgets.
45
+
你可以 [立即在 HTML 文件中添加 React](/docs/add-react-to-a-website.html),然后选择逐渐拓展它的应用范围,或只在一些动态小部件中使用它。
46
46
47
-
### Create a New React App {#create-a-new-react-app}
47
+
### 创建新的 React 应用 {#create-a-new-react-app}
48
48
49
-
When starting a React project, [a simple HTML page with script tags](/docs/add-react-to-a-website.html)might still be the best option. It only takes a minute to set up!
49
+
当你刚开始一个 React 应用时,[通过 HTML 的 script 标签引入 React](/docs/add-react-to-a-website.html)依然是最好的选项,因为这能让你的项目立即启动。
50
50
51
-
As your application grows, you might want to consider a more integrated setup. There are [several JavaScript toolchains](/docs/create-a-new-react-app.html) we recommend for larger applications. Each of them can work with little to no configuration and lets you take full advantage of the rich React ecosystem.
People come to React from different backgrounds and with different learning styles. Whether you prefer a more theoretical or a practical approach, we hope you'll find this section helpful.
The [React homepage](/)contains a few small React examples with a live editor. Even if you don't know anything about React yet, try changing their code and see how it affects the result.
If you feel that the React documentation goes at a faster pace than you're comfortable with, check out [this overview of React by Tania Rascia](https://www.taniarascia.com/getting-started-with-react/). It introduces the most important React concepts in a detailed, beginner-friendly way. Once you're done, give the documentation another try!
The React documentation assumes some familiarity with programming in the JavaScript language. You don't have to be an expert, but it's harder to learn both React and JavaScript at the same time.
We recommend going through [this JavaScript overview](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript)to check your knowledge level. It will take you between 30 minutes and an hour but you will feel more confident learning React.
>Whenever you get confused by something in JavaScript, [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript)and[javascript.info](http://javascript.info/)are great websites to check. There are also [community support forums](/community/support.html)where you can ask for help.
If you prefer to **learn by doing,** check out our [practical tutorial](/tutorial/tutorial.html). In this tutorial, we build a tic-tac-toe game in React. You might be tempted to skip it because you're not building games -- but give it a chance. The techniques you'll learn in the tutorial are fundamental to building *any* React apps, and mastering it will give you a much deeper understanding.
If you prefer to **learn concepts step by step,** our [guide to main concepts](/docs/hello-world.html)is the best place to start. Every next chapter in it builds on the knowledge introduced in the previous chapters so you won't miss anything as you go along.
Many React users credit reading [Thinking in React](/docs/thinking-in-react.html)as the moment React finally "clicked" for them. It's probably the oldest React walkthrough but it's still just as relevant.
Sometimes people find third-party books and video courses more helpful than the official documentation. We maintain [a list of commonly recommended resources](/community/courses.html), some of which are free.
Once you're comfortable with the [main concepts](#main-concepts) and played with React a little bit, you might be interested in more advanced topics. This section will introduce you to the powerful, but less commonly used React features like [context](/docs/context.html)and[refs](/docs/refs-and-the-dom.html).
This documentation section is useful when you want to learn more details about a particular React API. For example, [`React.Component` API reference](/docs/react-component.html)can provide you with details on how `setState()`works, and what different lifecycle methods are useful for.
106
+
当你想深入学习特定 React API 细节时,该章节将会变得非常有用。举个例子:[`React.Component` API 参考](/docs/react-component.html)能够介绍 `setState()`方法是如何工作的,以及不同生命周期方法的使用场景。
107
107
108
-
### Glossary and FAQ {#glossary-and-faq}
108
+
### 词汇表 & 常见问题 {#glossary-and-faq}
109
109
110
-
The [glossary](/docs/glossary.html)contains an overview of the most common terms you'll see in the React documentation. There is also a FAQ section dedicated to short questions and answers about common topics, including [making AJAX requests](/docs/faq-ajax.html), [component state](/docs/faq-state.html), and [file structure](/docs/faq-structure.html).
The [React blog](/blog/)is the official source for the updates from the React team. Anything important, including release notes or deprecation notices, will be posted there first.
Not every React release deserves its own blog post, but you can find a detailed changelog for every release [in the`CHANGELOG.md`file in the React repository](https://github.com/facebook/react/blob/master/CHANGELOG.md), as well as on the [Releases](https://github.com/facebook/react) page.
This documentation always reflects the latest stable version of React. Since React 16, you can find older versions of the documentation [on a separate page](/versions). Note that documentation for past versions is snapshotted at the time of the release, and isn't being continuously updated.
If something is missing in the documentation or if you found some part confusing, please [file an issue for the documentation repository](https://github.com/reactjs/reactjs.org/issues/new)with your suggestions for improvement, or tweet at the [@reactjsaccount](https://twitter.com/reactjs). We love hearing from you!
0 commit comments