我已经安装了 react developer tools
Chrome 中的扩展程序,如果我查看扩展程序列表,它被列为已启用。但是,在顶部菜单栏上,我有元素、控制台、源等,没有 React 选项卡。我可以打开我的 react-native 源文件之一,甚至可以在其中的断点处停止。
在 React 开发人员工具的自述文件中 gihub repository它指出
The "React" tab won't show up if React can't communicate with the devtools. When the page loads, the devtools sets a global named __REACT_DEVTOOLS_GLOBAL_HOOK__, then React communicates with that hook during initialization.
(In React 0.11 and older, it was necessary to expose a global called React for the devtools to function.)
You can test this on the React website or by inspecting Facebook.
在我的应用程序文件夹中,我没有直接使用 react,而是使用 react-native 并且相关版本是
react-native-cli: 0.1.10
react-native: 0.21.0
如果我访问 react-native 站点,会显示 React 选项卡,所以这可能与我的 react-native 设置有关。当我检查我的 react-native 应用程序时,如何让 React 选项卡出现?
最佳答案
It's currently not possible to use the "React" tab in the devtools to inspect app widgets. This is due to a change in how the application scripts are evaluated in the devtools plugin; they are now run inside a Web Worker, and the plugin is unaware of this and so unable to communicate properly with React Native.
https://facebook.github.io/react-native/docs/known-issues.html#devtools-react-tab-does-not-work
你可以试试http://nuclide.io/docs/platforms/react-native/#debugging__element-inspector正如在 github 上的问题中所建议的那样,但我无法让它与 RN 0.21 一起使用
关于google-chrome - React 选项卡未与 Chrome 的 React 开发人员工具一起显示在 react-native 应用程序上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35950226/