我目前使用React Native开发Android应用程序,并在Genymotion上进行仿真。我尝试使用这里描述的React Developer Tools调试我的应用程序。控制台中会抛出JS错误,但我无法在Chrome DevTools中选择React选项卡。
原因似乎是HTML中没有生成任何React组件,只有这些内容:
<body>
<div id="devtools-banner">
<h3>Install React DevTools</h3>
<p>
React Developer Tools is an extension that allows you to inspect the
React component hierarchies in the Chrome Developer Tools.
</p>
<a href="https://fb.me/react-devtools" target="_blank">
Install
</a>
</div>
<div class="content">
<p>
React Native JS code runs inside this Chrome tab.
</p>
<p>Press <span class="shortcut">⌘⌥J</span> to open Developer Tools. Enable <a href="https://dev59.com/x3E95IYBdhLWcg3wm_Mu#17324511" target="_blank">Pause On Caught Exceptions</a> for a better debugging experience.</p>
<p>Status: <span id="status">Debugger session #0 active.</span></p>
</div>
</body>
我遇到了iOS相同的问题。我如何在react native中使用React开发工具?
注意:我当前正在使用React开发工具的v0.14.5版本。
react
自版本0.25
起已成为直接导入,因此可能很快就会得到解决。 - kwelch