GoodGoodsImagesView.js
921 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
41
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;