Update docs for creating an android native view

Summary:
Doc changes only.  Updating example code to reflect the new requirements discussed in this [issue](https://github.com/facebook/react-native/issues/4605).

In short, in the JS code that registers your new native view, you need to explicitly include the `propTypes` that come default for views or else you get an error.
Closes https://github.com/facebook/react-native/pull/7281

Differential Revision: D3240654

Pulled By: mkonicek

fb-gh-sync-id: f7571ce7435c5b241a17af2822e7e350ce3186cb
fbshipit-source-id: f7571ce7435c5b241a17af2822e7e350ce3186cb
This commit is contained in:
Erem Zeit 2016-04-29 08:15:41 -07:00 committed by Facebook Github Bot 8
parent 708443e50c
commit 2b191bfab7
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,7 @@ The very final step is to create the JavaScript module that defines the interfac
// ImageView.js
import { PropTypes } from 'react';
import { requireNativeComponent } from 'react-native';
import { requireNativeComponent, View } from 'react-native';
var iface = {
name: 'ImageView',
@ -114,6 +114,7 @@ var iface = {
src: PropTypes.string,
borderRadius: PropTypes.number,
resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch']),
...View.propTypes // include the default view properties
},
};