-
Notifications
You must be signed in to change notification settings - Fork 417
/
TabNavigatorItem.js
36 lines (31 loc) · 905 Bytes
/
TabNavigatorItem.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
36
'use strict';
import React from 'react';
import PropTypes from 'prop-types';
import {
Text,
View,
} from 'react-native';
import ViewPropTypes from './config/ViewPropTypes';
export default class TabNavigatorItem extends React.Component {
static propTypes = {
renderIcon: PropTypes.func,
renderSelectedIcon: PropTypes.func,
badgeText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
renderBadge: PropTypes.func,
title: PropTypes.string,
titleStyle: Text.propTypes.style,
selectedTitleStyle: Text.propTypes.style,
tabStyle: ViewPropTypes.style,
selected: PropTypes.bool,
onPress: PropTypes.func,
allowFontScaling: PropTypes.bool,
};
static defaultProps = {
};
render() {
let child = React.Children.only(this.props.children);
return React.cloneElement(child, {
style: [child.props.style, this.props.style],
});
}
}