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
Copy file name to clipboardExpand all lines: docs/react-devtools-integration.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,21 @@
1
1
# React DevTools Integration
2
2
3
+
**_NOTE_** Supported React Native version is `>= 0.43`. Please downgrade RNDebugger version to `0.7.20` if you're using older versions of React Native.
4
+
3
5
The React DevTools is built by [`react-devtools-core/standalone`](https://github.com/facebook/react-devtools/tree/master/packages/react-devtools-core#requirereact-devtools-corestandalone), this is same with element inspector of [`Nuclide`](https://nuclide.io/docs/platforms/react-native/#debugging__element-inspector).
4
6
5
7
It will open a WebSocket server to waiting React Native connection. The connection already included in React Native (see [`setupDevtools.js`](https://github.com/facebook/react-native/blob/master/Libraries/Core/Devtools/setupDevtools.js)), it will keep trying to connect the React DevTools server in development mode, it should works well without specify anything, unless you need to set the server hostname for [use it with real device](#how-to-use-it-with-real-device).
6
8
7
-
We made the server listen a random port and inject `window.__REACT_DEVTOOLS_PORT__` global variable in debugger worker, note that the random port is only works with React Native version >= 0.39, otherwise it will fallback to `8097` (default port).
9
+
We made the server listen a random port and inject `window.__REACT_DEVTOOLS_PORT__` global variable in debugger worker.
8
10
9
11
For Android, we have the built-in `adb` util and it will reverse the port automatically.
@@ -39,23 +41,21 @@ The `RNDebugger DevTools` option is by default to match Chrome DevTools.
39
41
40
42
## How to use it with real device?
41
43
42
-
* Starting from RN `0.53.0-rc`, it should work by default.
43
-
* If you're debugging via Wi-Fi, you need to edit `setupDevtools.js` of React Native manually, change `'localhost'` to your machine IP.
44
-
*`< 0.37` - Find [`node_modules/react-native/Libraries/Devtools/setupDevtools.js`](https://github.com/facebook/react-native/blob/0.36-stable/Libraries/Devtools/setupDevtools.js) in your project, then change `hostname` variable.
45
-
*`>= 0.37 && < 0.43` - The same as above, but the path have been changed to [`Libraries/`**Core**/`Devtools/setupDevtools.js`](https://github.com/facebook/react-native/blob/0.37-stable/Libraries/Core/Devtools/setupDevtools.js)
46
-
*`>= 0.43` - The same as above, but use `host` property of `connectToDevTools` instead.
44
+
- Starting from RN `0.53.0-rc`, it should work by default.
45
+
- If you're debugging via Wi-Fi, you need to edit `setupDevtools.js` of React Native manually, change `'localhost'` to your machine IP.
46
+
-`>= 0.43` - The same as above, but use `host` property of `connectToDevTools` instead.
47
47
48
48
## Get `$r` global variable of React Native runtime in the console
49
49
50
50
Refer to [`Debugger Integration`](debugger-integration.md#debugging-tips).
0 commit comments