Giter Club home page Giter Club logo

debug-react-source-code's Introduction

如果这个项目对你有帮助,欢迎点个Star支持作者!

快速使用

方法1: 线上调试

访问地址:https://terry-su.github.io/debug-react-source-code/example/react-16.13.1

(推荐)方法2:下载对应直接调试源码文件

优势是可修改源码,比如在源码中添加注释。 使用步骤:

1 . 选择要调试的React版本对应分支,然后点击下载压缩包。

版本列表(持续更新):

2 . 将压缩包解压后,用vscode打开该文件夹。vscode需安装Debugger for Chrome插件,用于在vscode对源码添加断点

3 . 安装依赖后,开启服务

npm install
npm start

4 . 在源码中添加断点,按F5启动调试即可

目录结构

目录结构为:

/react.development/
/react-dom.development/
/babel.js
/dependency-main.html
/dependency-react.html
/dependency-react-dom.html
/index.html
/index.js

其中,index.js即为调试入口文件。

实现原理

“另辟蹊径搭建阅读React源码调试环境-支持所有React版本断点调试细分文件”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.