Skip to content
React 源码解析
JavaScript HTML C++ TypeScript CoffeeScript CSS Other
Branch: master
Clone or download
Pull request Compare This branch is 48 commits ahead, 417 commits behind facebook:master.
Latest commit 36b2644 Jul 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Store entire build directory as CI artifacts (facebook#15310) Apr 4, 2019
.github Reword issue template Jan 3, 2018
fixtures await act(async () => ...) (facebook#14853) Apr 2, 2019
packages 完成 class 组件调和部分注释 Jul 7, 2019
scripts Store entire build directory as CI artifacts (facebook#15310) Apr 4, 2019
.babelrc Remove ES3-specific transforms (facebook#12716) Apr 30, 2018
.editorconfig
.eslintignore Use Yarn Workspaces (facebook#11252) Oct 18, 2017
.eslintrc.js Refactor ESLint configuration to enable better IDE integration (faceb… Nov 8, 2018
.gitattributes .gitattributes to ensure LF line endings when we should Jan 18, 2014
.gitignore Remove 'flow-coverage-report' script. (facebook#13395) Aug 14, 2018
.mailmap Update .mailmap Sep 6, 2017
.nvmrc Add new docs website (facebook#10896) Sep 28, 2017
.prettierrc.js Add `use strict` to .prettierrc.js (facebook#13787) Oct 20, 2018
.watchmanconfig
AUTHORS Update authors for v16 (facebook#10861) Sep 27, 2017
CHANGELOG.md Changelog Mar 28, 2019
CODE_OF_CONDUCT.md Updated url to Code of Conduct page (facebook#13126) Jun 29, 2018
CONTRIBUTING.md [Gatsby] "https://facebook.github.io/react/" -> "https://reactjs.org/" ( Sep 30, 2017
LICENSE Drop the year from Facebook copyright headers and the LICENSE file. (f… Sep 7, 2018
README.md Update README.md Jul 28, 2019
appveyor.yml add nodejs 10 to windows test (facebook#13241) Aug 2, 2018
dangerfile.js Dangerfile exits early if build failed (facebook#14400) Dec 7, 2018
netlify.toml add netlify toml file (facebook#12350) May 20, 2018
package.json update gcc version (facebook#15034) Apr 4, 2019
yarn.lock update gcc version (facebook#15034) Apr 4, 2019

README.md

React 源码解析

这是一份 Fork 的 React 代码,版本为 16.8.6。

笔者会对这份代码做一个详细的核心源码解析。通过两个部分来完成这个解析:第一是加上这份代码的中文注释,第二是配套相应的文章。

你可以通过阅读我的 Commit 信息来了解到我是如何阅读这份代码的。

PS:不会对任何 DEV 环境下的代码做解读,类似以下代码:

if (__DEV__) {
	// ...
}

文章链接

需要注意一点:文章的风格分为了两部分。 从调度原理开始,笔者抛弃了单纯讲源码的方式。而是将重点放在了原理上,尽可能地脱离源码讲原理,这种方式能更快更好地让读者学习到知识。

线上阅读地址

Github 的阅读体验稍显逊色,你可以选择在我的网站上阅读。

一起学习

觉得内容有帮助可以关注下我的公众号 「前端真好玩」或者加入 React 源码交流群。

You can’t perform that action at this time.