Skip to content

Commit

Permalink
Fall back to View.propTypes if ViewPropTypes is not available (react-…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasters authored and patricio committed Sep 27, 2017
1 parent fc084e0 commit 2c8ddfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/components/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
NativeModules,
ColorPropType,
findNodeHandle,
View,
ViewPropTypes,
} from 'react-native';
import MapMarker from './MapMarker';
Expand Down Expand Up @@ -45,8 +46,11 @@ const viewConfig = {
},
};

// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
const viewPropTypes = ViewPropTypes || View.propTypes;

const propTypes = {
...ViewPropTypes,
...viewPropTypes,
/**
* When provider is "google", we will use GoogleMaps.
* Any value other than "google" will default to using
Expand All @@ -60,7 +64,7 @@ const propTypes = {
* Used to style and layout the `MapView`. See `StyleSheet.js` and
* `ViewStylePropTypes.js` for more info.
*/
style: ViewPropTypes.style,
style: viewPropTypes.style,

/**
* A json object that describes the style of the map. This is transformed to a string
Expand Down

0 comments on commit 2c8ddfe

Please sign in to comment.