Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to View.propTypes if ViewPropTypes is not available (#1473) #1474

Merged
merged 1 commit into from
Aug 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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