之前已经问过这个问题,但我找不到可行的解决方案,所以我冒昧地展示我的代码,以防万一我遗漏了一些东西。我有一个 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”
这是我在控制台中得到的错误。
任何帮助将不胜感激!
最佳答案
我通过运行在手机上调试应用程序时修复了相同的错误:
adb reverse tcp:5678 tcp:5678
允许手机连接到开发工具。如果使用不同的端口号,请调整端口号。如果您在计算机上的模拟器中运行该应用程序,这可能无济于事。
关于react-native - 远程 redux devtools 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51831096/