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

四、附录

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

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

相关推荐
sg_knight1 小时前
Spring Cloud与RabbitMQ深度集成:从入门到生产级实战
java·spring boot·spring·spring cloud·消息队列·rabbitmq·stream
Chan161 小时前
批处理优化:从稳定性、性能、数据一致性、健壮性、可观测性五大维度,优化批量操作
java·spring boot·后端·性能优化·java-ee·intellij-idea·优化
Bug退退退1232 小时前
Java 网络流式编程
java·服务器·spring·sse
汤姆yu2 小时前
基于springboot的家具商城销售系统
java·spring boot·后端
ruleslol3 小时前
SpringBoot13-小细节
spring boot·mybatis
不会写代码的加加4 小时前
告别重构噩梦:基于 Oinone 实现单体到微服务的平滑演进
spring boot·分布式
默默coding的程序猿4 小时前
1.单例模式有哪几种常见的实现方式?
java·开发语言·spring boot·spring·单例模式·设计模式·idea
安逸sgr4 小时前
SpringMVC启动流程
java·jvm·spring·spring cloud·eclipse·tomcat·maven
Vio7254 小时前
Ribbon负载均衡
spring cloud·ribbon·负载均衡
科兴第一吴彦祖5 小时前
基于Spring Boot + Vue 3的乡村振兴综合服务平台
java·vue.js·人工智能·spring boot·推荐算法