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),