【译】Build your own React

495 阅读1分钟

我们将一点点按照真实的 React 架构重写 React,同时忽略一些优化和不重要的功能。

这篇文章和之前我的文章 的不同点在于这篇是基于 React 16.8 的,我们基于 hook 来写 React,删去一切和 class 相关的内容。

之前文章的代码在这,相关的演讲在这

在开始重写前,我们需要明确我们会将这些内容一个个添加到我们 这个 React 中。

  • Step I: The createElement Function
  • Step II: The render Function
  • Step III: Concurrent Mode
  • Step IV: Fibers
  • Step V: Render and Commit Phases
  • Step VI: Reconciliation
  • Step VII: Function Components
  • Step VIII: Hooks

.........

全文: qcsite.gatsbyjs.io/build-your-…