You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
7
+
React Developer Tools is a powerful browser extension that helps you inspect React components, edit props and state, and identify performance issues. This guide provides practical, step-by-step examples to debug common React challenges, making it easier to build robust applications.
8
8
9
9
</Intro>
10
10
11
11
<YouWillLearn>
12
12
13
13
* How to install React Developer Tools
14
+
* How to debug component issues step-by-step
15
+
* How to identify and fix performance bottlenecks
16
+
* How to debug state updates and effects
17
+
* How to track down error sources effectively
14
18
15
19
</YouWillLearn>
16
20
17
-
## Browser extension {/*browser-extension*/}
21
+
## Browser Extension {/*browser-extension*/}
18
22
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:
23
+
The easiest way to debug React websites is to install the React Developer Tools browser extension, available for:
20
24
21
25
*[Install for **Chrome**](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
22
26
*[Install for **Firefox**](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/)
23
27
*[Install for **Edge**](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil)
24
28
25
-
Now, if you visit a website **built with React,** you will see the _Components_ and _Profiler_panels.
29
+
When you visit a React-built website, you'll see the _Components_ and _Profiler_tabs in your browser's developer tools.
## Mobile (React Native) {/*mobile-react-native*/}
56
64
57
-
To inspect apps built with [React Native](https://reactnative.dev/), you can use [React Native DevTools](https://reactnative.dev/docs/react-native-devtools), the built-in debugger that deeply integrates React Developer Tools. All features work identically to the browser extension, including native element highlighting and selection.
65
+
For React Native apps, use [React Native DevTools](https://reactnative.dev/docs/react-native-devtools), which integrates React Developer Tools for native element highlighting and debugging. Features mirror the browser extension.
58
66
59
67
[Learn more about debugging in React Native.](https://reactnative.dev/docs/debugging)
60
68
61
-
> For versions of React Native earlier than 0.76, please use the standalone build of React DevTools by following the [Safari and other browsers](#safari-and-other-browsers) guide above.
69
+
> For React Native versions before 0.76, follow the [Safari and other browsers](#safari-and-other-browsers) guide.
70
+
71
+
## Common Debugging Scenarios {/*common-debugging-scenarios*/}
72
+
73
+
React Developer Tools is most effective when used systematically. Below are practical examples to debug common issues, with step-by-step instructions and code snippets.
* **Console API**: Select a component in DevTools, then type `$r` in the console to inspect props (`$r.props`) or state (`$r.state` for class components).
346
+
* **Select in Editor**: Right-click a component in DevTools to jump to its source code in your IDE (if supported).
347
+
* **Time Travel**: Use DevTools to revert state changes and see how the UI responds, useful for debugging state transitions.
0 commit comments