微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

React Native Debbuger 的 0.11.7 版本连接到 React Native 版本 0.63.2 不能与 Expo Client 一起使用

如何解决React Native Debbuger 的 0.11.7 版本连接到 React Native 版本 0.63.2 不能与 Expo Client 一起使用

我正在使用 Expo 和 React Native 制作一个移动应用。我想将 React Native Debugger 集成到我的项目中以进行 React 但我遇到了问题。

具体连接到 react devtools 失败。我正在使用 Expo 客户端(通过 wifi 连接的真实设备)。 我读过 React Native Debugger's connect to React not working with Expo Client 但我使用的是较新版本的 React Native 调试器,所以这个问题对我没有帮助。在文件 node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js 中,我将主机变量更改为我的本地 IP,但也不起作用。

interface EmployeService() {

  List<EmployeeDto> getEmployeeList();

  List<EmployeeAddressDto> getDetailedEmployeeList();
}

};

在我拥有的项目根目录的 package.json 中:

  // Get hostname from development server (packager)
  const devServer = getDevServer();
  /*
  const host = devServer.bundleLoadedFromServer
    ? devServer.url.replace(/https?:\/\//,'').split(':')[0]
    : 'localhost';
  */
   const host = '192.168.0.108'
  // Read the optional global variable for backward compatibility.
  // It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0.
  const port =
    window.__REACT_DEVTOOLS_PORT__ != null
      ? window.__REACT_DEVTOOLS_PORT__
      : 8097;

  const WebSocket = require('../WebSocket/WebSocket');
  const ws = new WebSocket('ws://' + host + ':' + port);

  const viewConfig = require('../Components/View/ReactNativeViewViewConfig');
  reactDevTools.connectToDevTools({
    isAppActive,resolveRNStyle: require('../StyleSheet/flattenStyle'),nativeStyleEditorValidAttributes: Object.keys(
      viewConfig.validAttributes.style,),websocket: ws,});
}

},

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。