diff --git a/docs/NativeComponentsIOS.md b/docs/NativeComponentsIOS.md index e78d86714..759d27bf0 100644 --- a/docs/NativeComponentsIOS.md +++ b/docs/NativeComponentsIOS.md @@ -21,7 +21,7 @@ Vending a view is simple: - Create the basic subclass. - Add the `RCT_EXPORT_MODULE()` marker macro. -- Implement the `-(UIView *)view` method +- Implement the `-(UIView *)view` method. ```objective-c // RCTMapManager.m @@ -43,6 +43,7 @@ RCT_EXPORT_MODULE() @end ``` +**Note:** Do not attempt to set the `frame` or `backgroundColor` properties on the `UIView` instance that you vend through the `-view` method. React Native will overwrite the values set by your custom class in order to match your JavaScript component's layout props. If you need this granularity of control it might be better to wrap the `UIView` instance you want to style in another `UIView` and return the wrapper `UIView` instead. See [Issue 2948](https://github.com/facebook/react-native/issues/2948) for more context. Then you just need a little bit of JavaScript to make this a usable React component: