是否有任何好的文档/视频讨论如何使用 Nuclide 调试 react-native 应用程序。
我是新手。这是我第一次开发应用程序,也是第一次使用 React。
我确实使用 react-native init
创建了项目。我不认为我找到了一个 BUCK 文件供我运行和调试我的应用程序。我也不知道如何查看我的 JS 文件中的错误。我必须运行模拟器才能看到。我使用 react-native run-ios
运行它。
我尝试了 Nuclide->React Native->Start Debugging
。不确定这应该做什么。
如果这些问题听起来很愚蠢,我很抱歉。
最佳答案
根据 this instruction你应该:
来自 command Palette (Cmd-Shift-P) 选择“Nuclide React Native: Start Packager”以启动 React Native Server。
确保您位于 React Native 项目的根目录中,然后从命令行运行应用程序:“$ react-native run-ios”(或选择其他现有模拟器,例如 react- native 运行 ios --simulator="iPhone4s").
启动服务器后,您可以为应用程序开始运行准备 React Native 调试器。来自command Palette (Cmd-Shift-P),启动“Nuclide React Native:开始调试”。
在模拟器中按 Cmd-D(Linux 上为 Ctrl-D)。这将为您的应用程序调出调试选项。选择“远程调试 JS”。
...从模拟应用程序启用调试后,Nuclide 将自动附加到该调试进程,因为我们在上面启动了调试器。
关于react-native - 使用 nuclide 调试 react-native 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37005325/