Use requireNativeComponent in View.js.

Summary: public
In a previous diff I've removed a need for using View attributes in requireNativeComponent. Thanks to that we can now use requireNativeComponent in View module. In a follow up diff I'll be getting rid of ReactNativeViewAttributes.

Reviewed By: sahrens

Differential Revision: D2676088

fb-gh-sync-id: d5d6e50f4629bd7982b90f3496e1fd22078e96a8
This commit is contained in:
Krzysztof Magiera
2015-11-20 00:47:24 -08:00
committed by facebook-github-bot-0
parent 0d17d6a8c0
commit 7cd7591f04
3 changed files with 12 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheetPropType = require('StyleSheetPropType');
var ViewStylePropTypes = require('ViewStylePropTypes');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var requireNativeComponent = require('requireNativeComponent');
var stylePropType = StyleSheetPropType(ViewStylePropTypes);
@@ -316,11 +316,12 @@ var View = React.createClass({
},
});
var RCTView = createReactNativeComponentClass({
validAttributes: ReactNativeViewAttributes.RCTView,
uiViewClassName: 'RCTView',
var RCTView = requireNativeComponent('RCTView', View, {
nativeOnly: {
nativeBackgroundAndroid: true,
}
});
RCTView.propTypes = View.propTypes;
if (__DEV__) {
var viewConfig = RCTUIManager.viewConfigs && RCTUIManager.viewConfigs.RCTView || {};
for (var prop in viewConfig.nativeProps) {