mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-25 21:15:26 +08:00
refactor: remove unused getLabel method
This commit is contained in:
@@ -39,16 +39,6 @@ class TabNavigationView extends React.PureComponent<Props, State> {
|
||||
loaded: [this.props.navigation.state.index],
|
||||
};
|
||||
|
||||
_getLabel = ({ route, focused, tintColor }) => {
|
||||
const label = this.props.getLabelText({ route });
|
||||
|
||||
if (typeof label === 'function') {
|
||||
return label({ focused, tintColor });
|
||||
}
|
||||
|
||||
return label;
|
||||
};
|
||||
|
||||
_renderTabBar = () => {
|
||||
const {
|
||||
tabBarComponent: TabBarComponent = BottomTabBar,
|
||||
|
||||
@@ -27,24 +27,6 @@ class MaterialTabView extends React.PureComponent<Props> {
|
||||
}),
|
||||
};
|
||||
|
||||
_getLabel = ({ route, tintColor, focused }) => {
|
||||
const { descriptors } = this.props;
|
||||
const descriptor = descriptors[route.key];
|
||||
const options = descriptor.options;
|
||||
|
||||
if (options.tabBarLabel) {
|
||||
return typeof options.tabBarLabel === 'function'
|
||||
? options.tabBarLabel({ tintColor, focused })
|
||||
: options.tabBarLabel;
|
||||
}
|
||||
|
||||
if (typeof options.title === 'string') {
|
||||
return options.title;
|
||||
}
|
||||
|
||||
return route.routeName;
|
||||
};
|
||||
|
||||
_renderIcon = ({ focused, route, tintColor }) => {
|
||||
const { descriptors } = this.props;
|
||||
const descriptor = descriptors[route.key];
|
||||
|
||||
Reference in New Issue
Block a user