Leanpub Header

Skip to main content

《React 学习之道》The Road to React (简体中文版)

通往 React 实战大师之旅:掌握 React 最简单,且最实用的教程

如何掌握 React 存在特别多的路线图。本书提取这些路线图中的精华部分,并将其融入于一个应用程序的具体代码实现当中。 您将会构建一个属于自己的 React 应用程序。在本次学习之旅当中,您将学习 ES6,了解所有 React 的基础知识、先进理念,以及组件的内部状态管理。

通过 Twitter | Newsletter 获取更新

完整课程 | 博客

Free With Membership

This book is a translation into Chinese (Simplified) of The Road to React which was originally written in English

With Membership

Free!

$19.99

You pay

$19.99

Authors earn

$15.99
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
6,633
Readers
225
Pages
About

About

About the Book

《React 学习之道》会教您一些React的基础知识。通过这套教程,您可以使用纯 React 构建一个真正可用的应用程序,而不需要去理会其他复杂的工具。我将为您逐一介绍从开发环境的准备到部署上线的全部过程。本书每一章都包含一些额外的索引资料以及课后练习。在读完本书之后,您将会有能力依靠自己构建一个 React 应用。我,Robin Wieruch,以及整个社区会持续维护和更新这些资料。

通过《React 学习之道》,在开始陷入到更庞大的 React 生态圈之前,我想为您奠定一个良好的基础。它会通过一个真实可用的 React 应用来解释基本概念、设计模式以及最佳实践。

您将会学习构建您自己的 React 应用。这个应用会涉及一些真正可用的功能,比如分页,客户端缓存,以及像搜索和排序这样的交互功能。另外在这个过程中,您会慢慢从 JavaScript ES5 过渡到 JavaScript ES6。我希望这本书能充分体现我对 React 和 JavaScript 的热忱所在,并帮助您能够开始您的开发旅程。

您可以期望学到什么(目前为止...)

  • Hacker News的React版本
  • 没有复杂的配置
  • 用create-react-app来初始化你的应用
  • 高效而轻量级的代码
  • 使用 React Hooks 来做状态管理(目前为止...)
  • 和真实API的交互(Hacker News)
  • 高级用户交互
  • 客户端排序
  • 客户端过滤
  • 服务器端搜索
  • 客户端缓存的实现
  • 高阶函数和高阶组件
  • 用Jest进行组件的切片(snapshot)测试
  • 用Enzyme进行组件的单元测试
  • 过程中学到一些有用的工具库
  • 过程中的练习题和扩展阅读
  • 认同和巩固你的所学
  • 将您的应用部署到产品环境

您需要具备哪些知识?

在开始阅读本书之前,您应该熟悉 HTML、CSS 和 JavaScript(ES5)。本书将会传授 ES6 及其更高版本,如果您熟悉于其它不同的 SPA 框架或库,您应该对这些基本知识已经了然于心。如果您刚刚开始您的 Web 开发之旅,您应该优先学习并掌握 HTML、CSS 和 JavaScript,然后再来学习 React。

This book is a translation into Chinese (Simplified) of The Road to React which was originally written in English

Author

About the Authors

Robin Wieruch

Robin Wieruch is a german software engineer and freelancer located in Berlin. In the recent years he has gained experiences in single page applications which use Ember, Angular and React. He is a full-time JavaScript developer, is doing his best to teach students on his blog and strives to learn something new every day himself.

JimmyLv

吕靖(吕立青),ThoughtWorks 咨询师,Full Stack Developer。本书翻译来自 ThoughtWorks 的 JS Community 超豪华译者团队(排名不分先后):

@LeiZeng (曾磊)、@JimmyLv (吕靖)

@SBeator (曾星鑫)、@kenpusney (刘清)

@azzgo (文一山)、@trotyl (余泽江)

@ariesjia (陈嘉)、@Yixi (刘应皓)

@HelloRuiLi (李睿)、@lazurey (梁越)

@zengyang2014 (曾扬)、@liujiefengfeng (刘杰凤)

@futantan (傅坦坦)、@linksgo2011 (林宁)

Jiahao Li

李嘉豪,ThoughtWorks 前端工程师。感谢来自 ThoughtWorks JS Community 的各位译者(排名不分先后):

@lazurey(梁越)、@mengyaolin(林梦瑶)、@AmyShieh(谢长青)、@manyuanrong(满远荣)、@dcZhangTW(张迪) 、@SimonTal(陶星蒙)、@lixueying(李雪莹)、@ariesjia(陈嘉)、@zpc7(郑鹏程)、@reeli(李睿)、@LixingSun(孙力行)、@teobler(张起荣)、@ChenQing-coder(陈情)、@royooooooo(付毅)

Contents

Table of Contents

前言

  1. 关于作者
  2. FAQ
  3. 本书的面向人群

React 基础

  1. 你好 React
  2. 基本要求
  3. 建立一个 React 项目
  4. 认识React组件
  5. React JSX
  6. React 中的列表
  7. 认识另一种形式的React组件
  8. 实例化 React 组件
  9. React DOM
  10. React 函数定义 (高阶)
  11. JSX 中的处理函数
  12. React Props
  13. React State
  14. JSX 回调处理函数
  15. React 状态提升
  16. 受控组件
  17. Props 处理(高级)
  18. React 副作用
  19. 自定义 React Hook(高级)
  20. React Fragments
  21. 可复用组件
  22. React 组件组合
  23. 指令式 React
  24. JSX 中的内联处理函数
  25. React 异步数据
  26. React 条件渲染
  27. React状态进阶
  28. 不合理的状态
  29. React 获取数据
  30. React 重新获取数据
  31. React 中 Memoized 函数(高级)
  32. 使用 React 进行显式数据获取
  33. React中的第三方库
  34. React 中的 Async / Await (高阶)
  35. React 表单

React 的遗留问题

  1. React 类组件
  2. 命令式的 React

React 中的样式

  1. CSS in React
  2. React 中的 CSS 模块化
  3. React 中的样式组件
  4. React 中的 SVG

React 维护

  1. React 性能(高级)
  2. 在React中使用TypeScript
  3. 从单元测试到集成测试
  4. React 项目结构

真实 React 世界(高级)

  1. 排序
  2. 逆序排序
  3. 记住上一次的搜索记录
  4. 分页查询

部署 React 应用

  1. 构建过程
  2. 部署到 Firebase

大纲

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub