GoodGoodsImagesView.js 871 Bytes
import React from 'react';
import ReactNative from 'react-native';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';

let {
	requireNativeComponent,
	View
} = ReactNative;

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: PropTypes.arrayOf(
		PropTypes.string
	),
	...View.propTypes // 包含默认的View的属性
};

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

module.exports = GoodGoodsImagesView;