From 2836362ef2dca6acc05ec91cd657548a2d5b421d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 30 Mar 2015 20:20:33 +0000 Subject: [PATCH] update website --- docs/nativemodulesios.html | 2 +- docs/troubleshooting.html | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 docs/troubleshooting.html diff --git a/docs/nativemodulesios.html b/docs/nativemodulesios.html index e7a17e7358c..8a5ae1b568a 100644 --- a/docs/nativemodulesios.html +++ b/docs/nativemodulesios.html @@ -25,7 +25,7 @@ CalendarManager.: '4 Privet Drive, Surrey', time: date.toTime(), description: '...' -})

NOTE: About array and map

React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get NSArray with NSNumber and NSString. It's developer's responsibility to check array/map values types (see RCTConvert for helper methods).

Callbacks #

WARNING

This section is even more experimental than others, we don't have a set of best practices around callbacks yet.

Native module also supports a special kind of argument - callback. In most cases it is used to provide function call result to JavaScript.

- (void)findEvents:(RCTResponseSenderBlock)callback +})

NOTE: About array and map

React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get NSArray with NSNumber and NSString. It's the developer's responsibility to check array/map values types (see RCTConvert for helper methods).

Callbacks #

WARNING

This section is even more experimental than others, we don't have a set of best practices around callbacks yet.

Native module also supports a special kind of argument - callback. In most cases it is used to provide function call result to JavaScript.

- (void)findEvents:(RCTResponseSenderBlock)callback { RCT_EXPORT(); NSArray *events = ... diff --git a/docs/troubleshooting.html b/docs/troubleshooting.html new file mode 100644 index 00000000000..8b7ba0e548a --- /dev/null +++ b/docs/troubleshooting.html @@ -0,0 +1,19 @@ +React Native | A framework for building native apps using React

Troubleshooting

Cmd-R does not reload the simulator #

Enable iOS simulator's "Connect hardware keyboard" from menu Hardware > Keyboard menu.

Keyboard Menu

If you are using a non-QWERTY/AZERTY keyboard layout you can use the Hardware > Shake Gesture to bring up the dev menu and click "Refresh"

Port already in use red-screen #

red-screen

Something is probably already running on port 8081. You can either kill it or try to change which port the packager is listening to.

Kill process on port 8081 #

$ sudo lsof -n -i4TCP:8081 | grep LISTEN

then

$ kill -9 <cma process id>

Change the port in Xcode #

Edit AppDelegate.m to use a different port.

// OPTION 1 + // Load from development server. Start the server from the repository root: + // + // $ npm start + // + // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and + // iOS device are on the same Wi-Fi network. + jsCodeLocation = [NSURL URLWithString:@"http://localhost:9381/index.ios.bundle"];
© 2015 Facebook Inc.
\ No newline at end of file