6

[Update on March 20, 2019: If you have this issue, check out my post here!]

I'm making a mobile app using Expo and React Native. I would like to integrate React Native Debugger to my project for react and redux debugging. But am having trouble.

Specifically connecting to react devtools have failed. I think this is because I am using Expo client (real device connected via wifi).

According to the docs, I should follow this path.

enter image description here

Since my Expo version is 25.0.0, the RN version is 0.52. Therefore, I must edit the setupDevtools.js.

The problem is, this doc is confusing to me. And I'm not sure whether I'm doing the right thing. So far, as below, I have changed the host to my IP address. But this didn't work. I guess I'm doing something wrong. Could anyone help? Thanks in advance.

const host = PlatformConstants && PlatformConstants.ServerHost ?
      PlatformConstants.ServerHost.split(':')[0] :
      'localhost';

    reactDevTools.connectToDevTools({
      isAppActive,
      host: "116.0.157.7",
      // Read the optional global variable for backward compatibility.
      // It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0.
      port: window.__REACT_DEVTOOLS_PORT__,
      resolveRNStyle: require('../../StyleSheet/flattenStyle'),
    });
Tetsuya3850
  • 947
  • 1
  • 7
  • 15
  • Never mind! I have solved this problem. I was not understanding the difference between public IP and local IP. I was putting the public IP as host. Worked when I put the local IP. When you google what is my IP? What you get is the public IP. Rather, go to this site that shows you the local IP as well. (https://www.whatismyip.com/) – Tetsuya3850 Mar 10 '18 at 07:18
  • How do you get to the setupDevtools.js? – Thuy Jan 04 '19 at 20:39
  • node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js – Tetsuya3850 Mar 20 '19 at 01:38

0 Answers0