From 3501f2f6cbee7b37c1d6069897bb4678492b668b Mon Sep 17 00:00:00 2001 From: Travis CI Date: Thu, 30 Apr 2015 14:24:15 +0000 Subject: [PATCH] update website --- docs/nativecomponentsios.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/nativecomponentsios.html b/docs/nativecomponentsios.html index c4624efc8fb..e5b93de3dcf 100644 --- a/docs/nativecomponentsios.html +++ b/docs/nativecomponentsios.html @@ -31,7 +31,7 @@ class MapView extends } } -var RCTMap= requireNativeComponent('RCTMap', MapView); +var RCTMap = requireNativeComponent('RCTMap', MapView); MapView.propTypes = { /** @@ -41,7 +41,7 @@ MapView.propTypes = React.PropTypes.bool, + pitchEnabled: React.PropTypes.bool, }; module.exports = MapView;

Now we have a nicely documented wrapper component that is easy to work with. Note that we changed the second argument to requireNativeComponent from null to the new MapView wrapper component. This allows the infrastructure to verify that the propTypes match the native props to reduce the chances of mismatches between the ObjC and JS code.

Next, let's add the more complex region prop. We start by adding the native code:

// RCTMapManager.m @@ -91,7 +91,7 @@ MapView.propTypes = React.PropTypes.bool, + pitchEnabled: React.PropTypes.bool, /** * The region to be displayed by the map. @@ -155,7 +155,7 @@ MapView.propTypes { MKCoordinateRegion region = mapView.region; NSDictionary *event = @{ - @"target": [mapView reactTag], + @"target": mapView.reactTag, @"region": @{ @"latitude": @(region.center.latitude), @"longitude": @(region.center.longitude),