Permalink
Browse files

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
  • Loading branch information...
mkonicek committed Nov 3, 2016
1 parent 3a882c2 commit 5dbdb12d9198ef6337787ff944be388d2f5a1a80
Showing with 14 additions and 2 deletions.
  1. +14 −2 Libraries/Components/MapView/MapView.js
@@ -54,8 +54,7 @@ export type AnnotationDragState = $Enum<{

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

const MapView = React.createClass({

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

mixins: [NativeMethodsMixin],

propTypes: {

0 comments on commit 5dbdb12

Please sign in to comment.