我正在使用Expo和React Native制作移动应用程序 . 我想将React Native Debugger集成到我的反应和redux调试项目中 . 但我遇到了麻烦 .
具体连接到反应devtools失败了 . 我想这是因为我使用的是Expo客户端(通过wifi连接的真实设备) .
根据文件,我应该遵循这条道路 .
由于我的世博版本是25.0.0,因此RN版本是0.52 . 因此,我必须编辑setupDevtools.js .
问题是,这个文档对我来说很困惑 . 而且我不确定我是否做得对 . 到目前为止,如下所示,我已将主机更改为我的IP地址 . 但这没效果 . 我想我做错了什么 . 有人可以帮忙吗?提前致谢 .
const host = PlatformConstants && PlatformConstants.ServerHost ?
PlatformConstants.ServerHost.split(':')[0] :
'localhost';
reactDevTools.connectToDevTools({
isAppActive,
host: "116.0.157.7",
// Read the optional global variable for backward compatibility.
// It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0.
port: window.__REACT_DEVTOOLS_PORT__,
resolveRNStyle: require('../../StyleSheet/flattenStyle'),
});