React源码学习(一):如何学习React源码

本系列源码学习,是基于 v16.13.1,v17.x与v16.x区别并不太大!

一、如何正确的学习React源码?

  1. 找到Github,转到React仓库,fork / clone源码:React
  2. 查看Readme,在Documentation中有Contributing Guide(参与贡献指南)
  3. 点击跳转后,在"Development Workflow"中有如下一段话:

The easiest way to try your changes is to run yarn build react/index,react-dom/index --type=UMD and then open fixtures/packaging/babel-standalone/dev.html. This file already uses react.development.js from the build folder so it will pick up your changes.

最简单的方法就是先 git 下载 react 官方源码,然后编译成 UMD 库,再使用 fixtures/packaging/babel-standalone/dev.html,这个文件默认使用 react.development.js

我们可以修改react源码,然后build,再打开/刷新dev.html(也可以自己demo),就能学习了。

二、流程步骤:

  1. fork / clone source code;
  2. 进入根目录;
  3. yarn (国内情况...也许要墙);
  4. yarn build react/index,react-dom/index --type=UMD

三、关注官方资源

【React官方博客】

Dan Abramov 最近在 JSConf 上对 React 未来的一些新特性的介绍 - Beyond React 16(墙)

四、附录

【达人分享】
【其它博客】

喜欢的朋友记得点赞、收藏、关注哦!!!

相关推荐
2501_9167665421 小时前
【Springboot】数据层开发-数据源自动管理
java·spring boot·后端
软件管理系统1 天前
基于Spring Boot的便民维修管理系统
java·spring boot·后端
廋到被风吹走1 天前
【Spring】DispatcherServlet解析
java·后端·spring
廋到被风吹走1 天前
【Spring】PlatformTransactionManager详解
java·spring·wpf
それども1 天前
Spring Bean 的name可以相同吗
java·后端·spring
qq_12498707531 天前
基于微信小程序的电子元器件商城(源码+论文+部署+安装)
java·spring boot·spring·微信小程序·小程序·毕业设计
资生算法程序员_畅想家_剑魔1 天前
Java常见技术分享-11-责任链模式
java·spring boot·责任链模式
计算机程序设计小李同学1 天前
动漫之家系统设计与实现
java·spring boot·后端·web安全
程序员阿鹏1 天前
责任链模式
java·spring·servlet·tomcat·maven·责任链模式
黄俊懿1 天前
【深入理解SpringCloud微服务】Seata(AT模式)源码解析——全局事务的回滚
java·后端·spring·spring cloud·微服务·架构·架构师