WebStorm调试create-react-native-app

3

我应该在WebStorm的Run Debug Configuration中设置什么来调试由create-react-native-app创建的应用程序?

enter image description here

我不知道如何进行调试,因为它没有使用~/.node_modules/lib/node_modules/react-native-cli,而是使用一个名为react-native-scripts的自定义模块来启动编译:

package.json:

 "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "node node_modules/jest/bin/jest.js --watch",
    "menu": "adb shell input keyevent 82"
  },

这篇博客介绍了如何在WebStorm中使用React Native开发移动应用程序。您想知道这篇博客是否仍然适用吗?该博客文章今天/昨天已进行编辑,因此它应该是最新的。 - LazyOne
@LazyOne,我在文章中找不到与CRNA有关的任何内容,但我已经在上面留下了评论。主要问题是我需要弄清楚如何启动CRNA自己的React Native包以便于用WebStorm进行调试。 - RedGiant
@RedGiant 调试 create-react-native-app 应用程序需要提供 Expo 支持。不幸的是,这并不在我们最近的计划中。 - lena
2个回答


0

我认为你不能这样做,至少不是一种简单的方式,而且你为什么要这样做呢?

React Native通过Chrome开发者工具“开箱即用”地提供了出色的调试功能。在这里,您可以调试代码,无论是在模拟器上运行还是在真实设备上运行都可以。有关详细信息,请参见此处:https://facebook.github.io/react-native/docs/debugging.html


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接