diff --git a/docs/nativemodulesios.html b/docs/nativemodulesios.html index 140fcfa2b41..bff8a6d583d 100644 --- a/docs/nativemodulesios.html +++ b/docs/nativemodulesios.html @@ -14,8 +14,7 @@ } @end
Now from your JavaScript file you can call the method like this:
NOTE: JavaScript method names -The name of the method exported to JavaScript is the native method's name up to the first colon. React Native also defines a macro called
RCT_REMAP_METHODto specify the JavaScript method's name. This is useful when multiple native methods are the same up to the first colon and would have conflicting JavaScript names.
The return type of bridge methods is always void. React Native bridge is asynchronous, so the only way to pass a result to JavaScript is by using callbacks or emitting events (see below).
React Native supports several types of arguments that can be passed from JavaScript code to native module:
NSString)NSInteger, float, double, CGFloat, NSNumber)BOOL, NSNumber)NSArray) of any types from this listNSDictionary) with string keys and values of any type from this listRCTResponseSenderBlock)In our CalendarManager example, if we want to pass event date to native, we have to convert it to a string or a number:
NOTE: JavaScript method names
The name of the method exported to JavaScript is the native method's name up to the first colon. React Native also defines a macro called
RCT_REMAP_METHODto specify the JavaScript method's name. This is useful when multiple native methods are the same up to the first colon and would have conflicting JavaScript names.
The return type of bridge methods is always void. React Native bridge is asynchronous, so the only way to pass a result to JavaScript is by using callbacks or emitting events (see below).
React Native supports several types of arguments that can be passed from JavaScript code to native module:
NSString)NSInteger, float, double, CGFloat, NSNumber)BOOL, NSNumber)NSArray) of any types from this listNSDictionary) with string keys and values of any type from this listRCTResponseSenderBlock)In our CalendarManager example, if we want to pass event date to native, we have to convert it to a string or a number:
As CalendarManager.addEvent method gets more and more complex, the number of arguments will grow. Some of them might be optional. In this case it's worth considering changing the API a little bit to accept a dictionary of event attributes, like this: