【发布时间】:2020-10-31 06:50:18
【问题描述】:
在使用 create-react-app 进行开发时,我的浏览器在出现警告时进入调试器模式:
它破坏了 react-dev-tools 的源代码:
// --- Welcome to debugging with React DevTools ---
// This debugger statement means that you've enabled the "break on warnings" feature.
// Use the browser's Call Stack panel to step out of this override function-
// to where the original warning or error was logged.
如何停用此行为?
【问题讨论】:
-
这种行为非常烦人。我真的很想知道如何禁用它
-
这里是 Dan github.com/facebook/react/issues/19308#issuecomment-656682924 的分步说明,现在可以删除此行为
-
我的解决方案是将该特定文件黑箱化,以便调试器完全跳过它。除非您正在开发该插件,否则您应该很好地做到这一点。
标签: reactjs javascript-debugger