create-react-native-app: React-devtools not working

Hi everyone,

I usually use react-devtools to help me navigate my react project and inspect what is going on in my project. It’s a really helpful piece to debug.

Is there a way to have it working on the boilerplate without much efforts? And are you planning to implement it out of the box?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

This actually worked just fine for me on my Android device without making any changes. I don’t have an iOS device handy but did a quick search through the react-native source and noticed that PlatformConstants.ServerHost isn’t defined on iOS, so it will always use 'localhost' instead, which is why it only works in the simulator it seems. I think by just adding PlatformConstants.ServerHost to iOS this would work in most cases.

My solution: comment

@florianpnn @epitaphmike the new version of the CRNA template I released today includes RN 0.43, so this should all work. Let me know if you get a chance to try it, it’d be great to document in the user guide!

@epitaphmike I’m not sure exactly what you mean – those updates only went stable recently (less than 2 weeks ago, IIRC?), and I intend to release a new CRNA version in the next couple of days that includes them.

I just created a fresh project and followed the instructions here: https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md

  1. Created a fresh CRNA project
  2. yarn add --dev react-devtools
  3. added "devtools": "react-devtools" to my package.json’s scripts section
  4. yarn run ios, followed by yarn run devtools in a separate tab once the app had opened

And it seems to be mostly working:

screen shot 2017-03-28 at 1 32 39 pm

Can you provide more details about what you tried and what didn’t work? It may be a good idea to refer to the issue template for information that normally helps in debugging these issues.

If we can settle on a good set of steps to follow for getting this working, then I’d be very happy to add this to the user guide.

cc @gaearon