Skip to content

Commit 5dbdb12

Browse files
author
Martin Konicek
committed
Deprecate MapView in favor of airbnb/react-native-maps
Summary: Compared to the `<MapView>` that comes with React Native, [react-native-maps](https://github.com/airbnb/react-native-maps) work on Android and is more feature complete. It is actively maintained and used extensively (9.2k installs / month, see [JS.Coach](https://js.coach/react-native/react-native-maps?search=react-native-maps)). We think now is a good time to switch to react-native-maps in your applications and make `react-native-maps` the official `<MapView>` implementation for React Native. We are going to release the deprecated `<MapView>` as a separate npm module so you can migrate to `react-native-maps` at your own pace. **Test Plan** Checked the docs render correctly on the website: ``` cd website npm install npm start ``` <img width="696" alt="screenshot 2016-11-01 20 17 31" src="https://cloud.githubusercontent.com/assets/346214/19905831/480074b8-a070-11e6-8779-8e12343c2883.png"> Warning is shown: <img width="423" alt="screenshot 2016-11-01 20 39 21" src="https://cloud.githu Closes #10500 Differential Revision: D4119602 Pulled By: mkonicek fbshipit-source-id: 86780a98bf999e6047565ab66a5ebbd15e499a46
1 parent 3a882c2 commit 5dbdb12

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Libraries/Components/MapView/MapView.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export type AnnotationDragState = $Enum<{
5454

5555
/**
5656
* **IMPORTANT: This component is now DEPRECATED and will be removed
57-
* in January 2017 (React Native version 0.42). This component only supports
58-
* iOS.**
57+
* in React Native version 0.42. This component only supports iOS.**
5958
*
6059
* **Please use
6160
* [react-native-maps](https://github.com/airbnb/react-native-maps) by Airbnb
@@ -86,6 +85,19 @@ export type AnnotationDragState = $Enum<{
8685

8786
const MapView = React.createClass({
8887

88+
componentWillMount: function() {
89+
console.warn(
90+
'MapView is now deprecated and will be removed from React Native in version 0.42. ' +
91+
'Please use the react-native-maps module which is more feature complete ' +
92+
'and works on Android too: https://github.com/airbnb/react-native-maps\n' +
93+
'It is actively maintained and used extensively.\n\n' +
94+
'Once MapView is removed from React Native in v0.42, we will release the ' +
95+
'code as deprecated-react-native-ios-mapview. You will be able to ' +
96+
'continue using that and migrate to react-native-maps your own pace later.\n\n' +
97+
'For more info, check out https://github.com/facebook/react-native/pull/10500'
98+
);
99+
},
100+
89101
mixins: [NativeMethodsMixin],
90102

91103
propTypes: {

0 commit comments

Comments
 (0)