11---
2- title : React Developer Tools
2+ title : React 开发者工具
3+ translators :
4+ - dahui4dev
35---
46
57<Intro >
68
7- Use React Developer Tools to inspect React [ components] ( /learn/your-first-component ) , edit [ props] ( /learn/passing-props-to-a-component ) and [ state] ( /learn/state-a-components-memory ) , and identify performance problems.
9+ 使用 React 开发者工具检查 React [ components] ( /learn/your-first-component ) ,编辑 [ props] ( /learn/passing-props-to-a-component ) 和 [ state] ( /learn/state-a-components-memory ) ,并识别性能问题。
810
911</Intro >
1012
1113<YouWillLearn >
1214
13- * How to install React Developer Tools
15+ * 如何安装 React 开发者工具
1416
1517</YouWillLearn >
1618
17- ## Browser extension {/* browser-extension* /}
19+ ## 浏览器扩展 {/* browser-extension* /}
1820
19- The easiest way to debug websites built with React is to install the React Developer Tools browser extension. It is available for several popular browsers:
21+ 调试 React 构建的网站最简单的办法就是安装 React 开发者工具浏览器扩展。它可用于几种流行的浏览器:
2022
21- * [ Install for ** Chrome** ] ( https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en )
22- * [ Install for ** Firefox** ] ( https://addons.mozilla.org/en-US/firefox/addon/react-devtools/ )
23- * [ Install for ** Edge** ] ( https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil )
23+ * [ 安装 ** Chrome** 扩展 ] ( https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en )
24+ * [ 安装 ** Firefox** 扩展 ] ( https://addons.mozilla.org/en-US/firefox/addon/react-devtools/ )
25+ * [ 安装 ** Edge** 扩展 ] ( https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil )
2426
25- Now, if you visit a website ** built with React ** , you will see the _ Components _ and _ Profiler _ panels.
27+ 现在,如果你访问一个用 ** React 构建 ** 的网站,你将看到 ** Components ** 和 ** Profiler ** 面板。
2628
2729![ React Developer Tools extension] ( /images/docs/react-devtools-extension.png )
2830
29- ### Safari and other browsers {/* safari-and-other-browsers* /}
30- For other browsers (for example, Safari), install the [ ` react-devtools ` ] ( https://www.npmjs.com/package/react-devtools ) npm package :
31+ ### Safari 和其他浏览器 {/* safari-and-other-browsers* /}
32+ 为其他浏览器(比如, Safari),安装 [ ` react-devtools ` ] ( https://www.npmjs.com/package/react-devtools ) npm 包 :
3133``` bash
3234# Yarn
3335yarn global add react-devtools
@@ -36,26 +38,26 @@ yarn global add react-devtools
3638npm install -g react-devtools
3739```
3840
39- Next open the developer tools from the terminal:
41+ 接下来从终端打开开发者工具:
4042``` bash
4143react-devtools
4244```
4345
44- Then connect your website by adding the following ` <script> ` tag to the beginning of your website's ` <head> ` :
46+ 然后通过将以下 ` <script> ` 标签添加到你网站的 ` <head> ` 开头来连接你的网站:
4547``` html {3}
4648<html >
4749 <head >
4850 <script src =" http://localhost:8097" ></script >
4951```
5052
51- Reload your website in the browser now to view it in developer tools.
53+ 现在在浏览器里刷新你的网站,你可以在开发者工具里查看它。
5254
5355![ React Developer Tools standalone] ( /images/docs/react-devtools-standalone.png )
5456
55- ## Mobile ( React Native) {/* mobile-react-native* /}
56- React Developer Tools can be used to inspect apps built with [ React Native] ( https://reactnative.dev/ ) as well.
57+ ## 移动端( React Native) {/* mobile-react-native* /}
58+ React 开发者工具同样可检查用 [ React Native] ( https://reactnative.dev/ ) 构建的应用程序。
5759
58- The easiest way to use React Developer Tools is to install it globally:
60+ 使用 React 开发者工具最简单的办法就是全局安装它:
5961``` bash
6062# Yarn
6163yarn global add react-devtools
@@ -64,13 +66,13 @@ yarn global add react-devtools
6466npm install -g react-devtools
6567```
6668
67- Next open the developer tools from the terminal.
69+ 接下来从终端打开开发者工具:
6870``` bash
6971react-devtools
7072```
7173
72- It should connect to any local React Native app that's running.
74+ 它应该可以连接到任何正在运行的本地 React Native 应用程序。
7375
74- > Try reloading the app if developer tools doesn't connect after a few seconds.
76+ > 如果几秒钟后开发者工具未连接,请尝试重新加载应用程序。
7577
76- [ Learn more about debugging React Native. ] ( https://reactnative.dev/docs/debugging )
78+ [ 了解有关调试 React Native 的更多信息 ] ( https://reactnative.dev/docs/debugging ) 。
0 commit comments