[react-native] Fix documentation extraction for View

This commit is contained in:
Ben Alpert 2015-03-31 16:12:55 -07:00
parent 9e931e9d36
commit b2fc956858
2 changed files with 12 additions and 8 deletions

View File

@ -12,9 +12,7 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var ReactClass = require('ReactClass');
var ReactElement = require('ReactElement');
var ReactIOSComponentMixin = require('ReactIOSComponentMixin');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var StyleSheetPropType = require('StyleSheetPropType');
var ViewStylePropTypes = require('ViewStylePropTypes');
@ -44,8 +42,8 @@ var stylePropType = StyleSheetPropType(ViewStylePropTypes);
* `View`s are designed to be used with `StyleSheet`s for clarity and
* performance, although inline styles are also supported.
*/
var View = ReactClass.createClass({
mixins: [NativeMethodsMixin, ReactIOSComponentMixin],
var View = React.createClass({
mixins: [NativeMethodsMixin],
/**
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
@ -140,7 +138,7 @@ var View = ReactClass.createClass({
},
render: function() {
return ReactElement.createElement(RCTView, this.props);
return <RCTView {...this.props} />;
},
});

View File

@ -36,7 +36,8 @@ var ReactNativeComponent = require('ReactNativeComponent');
var ReactUpdates = require('ReactUpdates');
var ResponderEventPlugin = require('ResponderEventPlugin');
var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle');
var View = require('View');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
// Just to ensure this gets packaged, since its only caller is from Native.
require('RCTEventEmitter');
@ -79,7 +80,12 @@ function inject() {
ReactIOSComponentEnvironment
);
ReactEmptyComponent.injection.injectEmptyComponent(View);
// Can't import View here because it depends on React to make its composite
var RCTView = createReactIOSNativeComponentClass({
validAttributes: {},
uiViewClassName: 'RCTView',
});
ReactEmptyComponent.injection.injectEmptyComponent(RCTView);
EventPluginUtils.injection.injectMount(ReactIOSMount);