fix: maintain backward compat for activeTintColor and inactiveTintColor

This commit is contained in:
Satyajit Sahoo
2018-09-07 11:55:55 +02:00
parent 4f6070d368
commit ea95fa69e1

View File

@@ -5,8 +5,8 @@ import { BottomNavigation } from 'react-native-paper';
import { createTabNavigator, type InjectedProps } from 'react-navigation-tabs'; import { createTabNavigator, type InjectedProps } from 'react-navigation-tabs';
type Props = InjectedProps & { type Props = InjectedProps & {
activeColor?: string, activeTintColor?: string,
inactiveColor?: string, inactiveTintColor?: string,
}; };
class BottomNavigationView extends React.Component<Props> { class BottomNavigationView extends React.Component<Props> {
@@ -32,8 +32,8 @@ class BottomNavigationView extends React.Component<Props> {
render() { render() {
const { const {
activeColor, activeTintColor,
inactiveColor, inactiveTintColor,
navigation, navigation,
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
descriptors, descriptors,
@@ -49,13 +49,14 @@ class BottomNavigationView extends React.Component<Props> {
return ( return (
<BottomNavigation <BottomNavigation
// Pass these for backward compaibility
activeColor={activeTintColor}
inactiveColor={inactiveTintColor}
{...rest} {...rest}
renderIcon={this._renderIcon} renderIcon={this._renderIcon}
barStyle={[barStyle, extraStyle]} barStyle={[barStyle, extraStyle]}
navigationState={navigation.state} navigationState={navigation.state}
getColor={this._getColor} getColor={this._getColor}
activeColor={activeColor}
inactiveColor={inactiveColor}
/> />
); );
} }