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(墙)

四、附录

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

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

相关推荐
CopyLower8 分钟前
在 Spring Boot 中实现 WebSockets
spring boot·后端·iphone
IT小辉同学22 分钟前
Docker如何更换镜像源提高拉取速度
spring cloud·docker·eureka
.生产的驴1 小时前
SpringBoot 封装统一API返回格式对象 标准化开发 请求封装 统一格式处理
java·数据库·spring boot·后端·spring·eclipse·maven
晨集1 小时前
Uni-App 多端电子合同开源项目介绍
java·spring boot·uni-app·电子合同
时间之城1 小时前
笔记:记一次使用EasyExcel重写convertToExcelData方法无法读取@ExcelDictFormat注解的问题(已解决)
java·spring boot·笔记·spring·excel
李菠菜2 小时前
POST请求的三种编码及SpringBoot处理详解
spring boot·后端
ApeAssistant4 小时前
Spring + 设计模式 (十四) 行为型 - 观察者模式
spring·设计模式
ApeAssistant4 小时前
Spring + 设计模式 (十三) 行为型 - 策略模式
spring·设计模式
斜月4 小时前
Springboot wechatpay-java 微信支付实践
spring boot·后端
yuren_xia5 小时前
Spring XML 配置
xml·java·spring