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:
parent
708443e50c
commit
2b191bfab7
|
@ -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
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue