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

四、附录

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

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

相关推荐
无心水10 分钟前
爆款实战!Vue3+Spring Boot+MySQL实现电商商品自动分类系统(含三级类目管理+规则兜底)
spring boot·mysql·分类·vue3商品分类·spring boot电商系统·三级类目管理·商品自动分类
qq_124987075325 分钟前
基于springboot的幼儿园家校联动小程序的设计与实现(源码+论文+部署+安装)
java·spring boot·后端·spring·微信小程序·小程序
后端小张1 小时前
【Java 进阶】深入理解Redis:从基础应用到进阶实践全解析
java·开发语言·数据库·spring boot·redis·spring·缓存
楠枬1 小时前
Nacos
java·spring·spring cloud·微服务
野生技术架构师1 小时前
SpringBoot+Elasticsearch实现高效全文搜索
spring boot·elasticsearch·jenkins
bailaoshi6661 小时前
Spring WebFlux整合reactor-rabbitmq
spring·rabbitmq·java-rabbitmq
Angletank2 小时前
SpringBoot中ORM组件通过JAP组件的使用
spring boot·后端·orm·jpa
白宇横流学长2 小时前
基于SpringBoot实现的零食销售商城设计与实现【源码+文档】
java·spring boot·后端
驱动探索者2 小时前
[缩略语大全]之[INTEL]篇
java·后端·spring·intel