如何运行react源码
运行 React 源码的步骤
克隆 React 源码仓库
从官方 GitHub 仓库克隆 React 源码:
git clone https://github.com/facebook/react.git
安装依赖
进入项目目录并安装依赖:
cd react
yarn
构建 React

运行构建脚本以生成开发环境下的代码:
yarn build
运行测试环境
启动本地开发服务器以测试修改后的代码:

yarn start
链接本地 React 版本
在另一个项目中使用本地构建的 React 版本:
cd /path/to/your/project
yarn link ../react/build/node_modules/react
验证修改
在测试项目中验证 React 的行为是否符合预期。






