forked from AlbertBrand/react-native-android-tablayout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tab.js
35 lines (30 loc) · 724 Bytes
/
Tab.js
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
import React from 'react-native';
const {
PropTypes,
requireNativeComponent,
View,
} = React;
class Tab extends React.Component {
static propTypes = {
...View.propTypes,
name: PropTypes.string,
iconUri: PropTypes.string,
iconResId: PropTypes.string,
iconPackage: PropTypes.string,
iconSize: PropTypes.number,
onTabSelected: PropTypes.func,
};
_onTabSelected(e:Event) {
this.props.onTabSelected && this.props.onTabSelected(e);
}
render() {
return (
<AndroidTab
{...this.props}
onTabSelected={this._onTabSelected.bind(this)}
collapsable={false}/>
);
}
}
const AndroidTab = requireNativeComponent('Tab', Tab);
module.exports = Tab;