You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 文件位置: /react/packages/react-reconciler/src/ReactFiberHostConfig.js-importinvariantfrom'shared/invariant';-invariant(false,'This module must be shimmed by a specific renderer.');+// FIXME: REACT SOURCE CODE DEBUG+export*from'./forks/ReactFiberHostConfig.dom'
// 文件位置: /react/packages/shared/invariant.jsexportdefaultfunctioninvariant(condition,format,a,b,c,d,e,f){+// FIXME: REACT SOURCE CODE DEBUG+if(condition){+return;+}thrownewError('Internal React error: invariant() is meant to be replaced at compile '+'time. There is no runtime version.',);}
通过这种方式只能调试编译之后的代码,不能实现原汁原味的源代码调试体验。查阅一些社区的实现,记录下步骤,方便后续查阅。
也可以直接 clone 配置好的仓库:https://github.com/shanejix/react-source-code-debug
步骤
eslintrc.json
文件,内容如下Scheduler
导出react
react-dom
引入方式// 删除 node_modules 文件夹,执行 npm install / yarn // 根目录下 rm -fr node_modules && yarn
references
The text was updated successfully, but these errors were encountered: