我已react developer tools
在Chrome中安装了该扩展程序,如果我查看扩展程序列表,它会被列为已启用。但是,在顶部菜单栏上,我有Elements,Console,Sources等,没有React选项卡。我可以打开我的本机源文件之一,甚至可以在其中的断点处停止。
在react开发人员工具gihub存储库的自述文件中,它声明
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设置有关。当我检查我的本机应用程序时,如何显示“反应”选项卡?
当前无法使用devtools中的“ React”标签来检查应用程序小部件。这是由于在devtools插件中评估应用程序脚本的方式发生了变化。它们现在在Web Worker中运行,并且插件未意识到这一点,因此无法与React Native正常通信。
https://facebook.github.io/react-native/docs/known-issues.html#devtools-react-tab-does-not-work
您可以按照github上的建议尝试使用http://nuclide.io/docs/platforms/react-native/#debugging__element-inspector,但我无法使其与RN 0.21一起使用
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句