GoodGoodsImagesView.js 921 Bytes
import React from 'react';
import ReactNative from 'react-native';
import ImmutablePropTypes from 'react-immutable-proptypes';

let {
	requireNativeComponent,
	View
} = ReactNative;

module.exports = requireNativeComponent('YH_GoodGoodsImagesView', null);

class GoodGoodsImagesView extends React.Component {

	constructor(props) {
		super(props);

    	this._onClick = this._onClick.bind(this);
  	}

  	_onClick(event: Event) {
    	if (!this.props.onClick) {
      		return;
    	}
    	this.props.onClick(event.nativeEvent);
  	}

	render() {
		return <YH_GoodGoodsImagesView {...this.props} items={this.props.items} />;
	}
}

GoodGoodsImagesView.propTypes = {
	items: React.PropTypes.arrayOf(
		React.PropTypes.string
	),
	...View.propTypes // 包含默认的View的属性
};

let YH_GoodGoodsImagesView = requireNativeComponent('YH_GoodGoodsImagesView', GoodGoodsImagesView);

module.exports = GoodGoodsImagesView;