Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm + ReactNative?

Is it possible to debug ReactNative code from WebStorm? ReactNative allows debug from Chrome/Safari, maybe WebStorm could use these ports for debugging from IDE somehow?

like image 363
aksonov Avatar asked Jun 17 '15 07:06

aksonov


People also ask

Can I use WebStorm for React Native?

WebStorm will start the React Native packager first in a new React Native tool window and then will run the react-native run-ios or react-native run-android command, depending on the selected target platform. If the build is successful, you'll see your app in an emulator.

Is WebStorm good for react?

WebStorm provides code completion for React APIs and JSX in JavaScript code. Code completion works for React methods, React-specific attributes, HTML tags and component names, React events, component properties, and so on.

Which Jetbrains IDE for React Native?

IntelliJ IDEA helps you create, edit, lint, run, debug, and maintain your React Native applications.


2 Answers

With the new 2016.3 EAP of WebStorm and as well IDEA you can now debug react-native apps:

https://blog.jetbrains.com/webstorm/2016/10/webstorm-2016-3-eap-163-6512/

like image 190
Paul Reichelt Avatar answered Oct 20 '22 00:10

Paul Reichelt


According to the React Native Docs, there's no way to do it right now.

Why? Because when using "Debug in Chrome," you're actually running all your Javascript code inside of Chrome! The native app simply pulls all the data from Chrome via websocket.

So to implement React Native debugging in WebStorm, it seems like you'll need to come up with either of the following:

  1. A way to run your JS code inside of WebStorm, passing the data to the native app via websocket.
  2. A way to modify React Native's Chrome-side code to allow WebStorm to connect to it, like GDB would to a C application.

Hope this helps.

like image 38
David Kay Avatar answered Oct 19 '22 22:10

David Kay