Skip to content

Commit 1f558b1

Browse files
markrickertchristopherdro
authored andcommitted
Fixes issue running on ReactNative 0.42.3 - 'MapMarker' has no propType for native prop 'AIRMapMarker.testId' of native type 'String' (react-native-maps#1792)
* Be less specific about react-native version for android * Relax play services dependencies as well * Fixes issue with ReactNative 0.42.3 * Update MapMarker.js * Make all components use ViewPropTypes || View.propTypes
1 parent 2ce5c26 commit 1f558b1

7 files changed

+31
-7
lines changed

lib/components/MapCallout.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import React from 'react';
33
import {
44
StyleSheet,
55
ViewPropTypes,
6+
View,
67
} from 'react-native';
78
import decorateMapComponent, {
89
SUPPORTED,
910
USES_DEFAULT_IMPLEMENTATION,
1011
} from './decorateMapComponent';
1112

13+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
14+
const viewPropTypes = ViewPropTypes || View.propTypes;
15+
1216
const propTypes = {
13-
...ViewPropTypes,
17+
...viewPropTypes,
1418
tooltip: PropTypes.bool,
1519
onPress: PropTypes.func,
1620
};

lib/components/MapCircle.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import {
44
ViewPropTypes,
5+
View,
56
} from 'react-native';
67
import decorateMapComponent, {
78
USES_DEFAULT_IMPLEMENTATION,
89
SUPPORTED,
910
} from './decorateMapComponent';
1011

12+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
13+
const viewPropTypes = ViewPropTypes || View.propTypes;
14+
1115
const propTypes = {
12-
...ViewPropTypes,
16+
...viewPropTypes,
1317

1418
/**
1519
* The coordinate of the center of the circle

lib/components/MapMarker.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Animated,
88
findNodeHandle,
99
ViewPropTypes,
10+
View,
1011
} from 'react-native';
1112

1213
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
@@ -22,8 +23,11 @@ const viewConfig = {
2223
},
2324
};
2425

26+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
27+
const viewPropTypes = ViewPropTypes || View.propTypes;
28+
2529
const propTypes = {
26-
...ViewPropTypes,
30+
...viewPropTypes,
2731

2832
// TODO(lmr): get rid of these?
2933
identifier: PropTypes.string,

lib/components/MapPolygon.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import {
44
ViewPropTypes,
5+
View,
56
} from 'react-native';
67
import decorateMapComponent, {
78
USES_DEFAULT_IMPLEMENTATION,
89
SUPPORTED,
910
} from './decorateMapComponent';
1011

12+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
13+
const viewPropTypes = ViewPropTypes || View.propTypes;
14+
1115
const propTypes = {
12-
...ViewPropTypes,
16+
...viewPropTypes,
1317

1418
/**
1519
* An array of coordinates to describe the polygon

lib/components/MapPolyline.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import {
44
ViewPropTypes,
5+
View,
56
} from 'react-native';
67
import decorateMapComponent, {
78
USES_DEFAULT_IMPLEMENTATION,
89
SUPPORTED,
910
} from './decorateMapComponent';
1011

12+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
13+
const viewPropTypes = ViewPropTypes || View.propTypes;
14+
1115
const propTypes = {
12-
...ViewPropTypes,
16+
...viewPropTypes,
1317

1418
/**
1519
* An array of coordinates to describe the polygon

lib/components/MapUrlTile.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import React from 'react';
33

44
import {
55
ViewPropTypes,
6+
View,
67
} from 'react-native';
78

89
import decorateMapComponent, {
910
USES_DEFAULT_IMPLEMENTATION,
1011
SUPPORTED,
1112
} from './decorateMapComponent';
1213

14+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
15+
const viewPropTypes = ViewPropTypes || View.propTypes;
16+
1317
const propTypes = {
14-
...ViewPropTypes,
18+
...viewPropTypes,
1519

1620
/**
1721
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime

lib/components/MapView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
NativeModules,
99
ColorPropType,
1010
findNodeHandle,
11-
View,
1211
ViewPropTypes,
12+
View,
1313
} from 'react-native';
1414
import MapMarker from './MapMarker';
1515
import MapPolyline from './MapPolyline';

0 commit comments

Comments
 (0)