gpt4 book ai didi

react-native - 摆脱 React Native 中的 "Remote debugger is in a background tab"警告

转载 作者:行者123 更新时间:2023-12-03 05:10:17 25 4
gpt4 key购买 nike

我启动了一个新的 React Native 项目,但不断收到以下警告:

Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window).

这有点烦人,所以我想知道如何摆脱它?我正在 Chrome 中运行调试器,并将其移至单独的窗口,但没有帮助。

最佳答案

如果调试器窗口中有维护优先级复选框,请在跳转到下面的任何解决方案之前尝试启用它。

要消除整个项目中的警告,请将以下内容添加到您的最外面 Javascript 文件(大多数情况下是 React Native 的 index.js)

对于 react native v0.63+:

使用LogBox: https://reactnative.dev/docs/debugging#logbox

LogBox.ignoreLogs(['Remote debugger']);

对于 react native v0.57 - v0.62:

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Remote debugger']);

引用官方 React Native 文档:

https://facebook.github.io/react-native/docs/debugging.html

react-native v0.56 或以下:

在代码中尽早添加以下内容:

console.ignoredYellowBox = ['Remote debugger'];

简单、简单且针对该错误。对我有用。可以替换您想要的任何文本。

关于react-native - 摆脱 React Native 中的 "Remote debugger is in a background tab"警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41146446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com