From 4d33033344d8b4423b7d7f197f33793d082f60bf Mon Sep 17 00:00:00 2001 From: Francois Laberge Date: Sat, 28 Mar 2015 19:28:51 -0400 Subject: [PATCH] Add basic documentation for debugging react native apps --- docs/Debugging.md | 19 +++++++++++++++++++ docs/NativeModulesIOS.md | 2 +- website/src/react-native/index.js | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docs/Debugging.md diff --git a/docs/Debugging.md b/docs/Debugging.md new file mode 100644 index 000000000..ed5cef542 --- /dev/null +++ b/docs/Debugging.md @@ -0,0 +1,19 @@ +--- +id: debugging +title: Debugging +layout: docs +category: Guides +permalink: docs/debugging.html +next: testing +--- + +## Debugging React Native Apps +To debug the javascript code of your react app do the following: + + 1. Run your application in the iOS simulator. + 2. Press ```Command + D``` and a webpage should open up at [http://localhost:8081/debugger-ui](http://localhost:8081/debugger-ui). (Chrome only for now) + 3. Press ```Command + Option + I``` to open the Chrome Developer tools, or open it via ```View``` -> ```Developer``` -> ```Developer Tools```. + 4. You should now be able to debug as you normally would. + +### Optional +Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) extension for Google Chrome. This will allow you to navigate the view hierarchy if you select the ```React``` tab when the developer tools are open. \ No newline at end of file diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index db53cd0ed..a9037f002 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -4,7 +4,7 @@ title: Native Modules (iOS) layout: docs category: Guides permalink: docs/nativemodulesios.html -next: testing +next: debugging --- Sometimes an app needs access to platform API, and React Native doesn't have a corresponding wrapper yet. Maybe you want to reuse some existing Objective-C or C++ code without having to reimplement it in JavaScript. Or write some high performance, multi-threaded code such as image processing, network stack, database or rendering. diff --git a/website/src/react-native/index.js b/website/src/react-native/index.js index 7ca53cef6..13f2c9be2 100644 --- a/website/src/react-native/index.js +++ b/website/src/react-native/index.js @@ -66,6 +66,9 @@ var App = React.createClass({

All operations between the JavaScript application code and the native platform are performed asynchronously, and the native modules can also make use of additional threads as well. This means we can decode images off of the main thread, save to disk in the background, measure text and compute layouts without blocking the UI, and more. As a result, React Native apps are naturally fluid and responsive. The communication is also fully serializable, which allows us to leverage Chrome Developer Tools to debug the JavaScript while running the complete app, either in the simulator or on a physical device.

+

+ See Debugging. +

Touch Handling