From 2b191bfab71cb53e340f701cedeb96ad5ddfaea6 Mon Sep 17 00:00:00 2001 From: Erem Zeit Date: Fri, 29 Apr 2016 08:15:41 -0700 Subject: [PATCH] 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 --- docs/NativeComponentsAndroid.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/NativeComponentsAndroid.md b/docs/NativeComponentsAndroid.md index 62a0cc95a..b9e01426b 100644 --- a/docs/NativeComponentsAndroid.md +++ b/docs/NativeComponentsAndroid.md @@ -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 }, };