GoodGoodsImagesView.js
871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;