react-native - 远程 redux devtools 停止工作

标签 react-native redux remote-debugging redux-devtools

之前已经问过这个问题,但我找不到可行的解决方案,所以我冒昧地展示我的代码,以防万一我遗漏了一些东西。我有一个 native 应用程序并使用 redux。我已经在这个项目上使用 remote-redux-devtools 两个月了,但该工具突然停止工作。我在控制台中收到“SocketProtocolError”,并将其粘贴在下面以及我的代码中。

Redux 商店

import { createStore, applyMiddleware } from "redux";
import { composeWithDevTools } from "remote-redux-devtools";
import thunk from "redux-thunk";
import reducers from "../../State/reducers/index";

const composeEnhancers = composeWithDevTools({ realtime: true });

const store = createStore(
  reducers,
  {},
  composeEnhancers(applyMiddleware(thunk))
);

export default store;

在我的 package.json 文件中,我使用“remote-redux-devtools”:“^0.5.13”

这是我在控制台中得到的错误。 enter image description here

任何帮助将不胜感激!

最佳答案

我通过运行在手机上调试应用程序时修复了相同的错误:

adb reverse tcp:5678 tcp:5678

允许手机连接到开发工具。如果使用不同的端口号,请调整端口号。如果您在计算机上的模拟器中运行该应用程序,这可能无济于事。

关于react-native - 远程 redux devtools 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51831096/

相关文章:

react-native-document-picker : Type error-->undefined document picker while calling document picker. 在 react native 0.61.2 中显示

javascript - 将 redux store 实现为函数而不是类的原因是什么?

javascript - Redux:调用 action-creator 返回 'Cannot read property ' props' of undefined'

javascript - 我应该在哪里放置与 redux 中的 Action 相关的同步副作用?

php - 远程服务器未连接的 Xdebug - netbeans

azure - Visual Studio 2022 调试 Azure 应用服务

c++ - 使用 RSE 进行远程 C++ 调试

javascript - 根据 react native 中的平台显示/隐藏导航标题

reactjs - React JS - 从渲染表中的行获取数据以编辑数据

android - React-Native 集成 支持 V2 Pro 设备 SunMI