反应开发工具不在Chrome浏览器中加载 [英] react dev tools not loading in Chrome browser

查看:100
本文介绍了反应开发工具不在Chrome浏览器中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试使用React.js的应用程序,Chrome扩展列表清楚地显示了React Developer Tools已安装,并且当我访问 http://facebook.github.io/react/ 我可以在开发人员工具窗口中清楚地看到反应标签。然而,当我调试我的应用程序时,我在控制台中看到了这一点:

下载React DevTools以获得更好的开发体验:http:// fb.me/react-devtools React.js:87



有人能告诉我如何使用React Developer Tools? / p>

感谢!

解决方案

您不再需要做任何事情。 / p>




对于较早的反应版本,主要要求是设置window.React。如果您使用的是模块系统:

  if(typeof window!=='undefined'){
window .React = React;
}

这通常应在您的主源文件中完成。


I'm debugging an application which uses React.js, the Chrome Extensions list clearly shows that the React Developer Tools are installed, and when i access the React site at http://facebook.github.io/react/ i can clearly see a "React" tab in the developer tools window. Yet when i'm debugging my application i see this in the console:

Download the React DevTools for a better development experience: http://fb.me/react-devtools React.js:87

Can someone tell me how to get it to use the React Developer Tools?

thanks!

解决方案

You no longer need to do anything.


For older react versions, the main requirement is that window.React is set. If you're using a module system:

if (typeof window !== 'undefined') {
    window.React = React;
}

This should usually be done in your main source file.

这篇关于反应开发工具不在Chrome浏览器中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆