mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 21:05:29 +08:00
fix: maintain backward compat for activeTintColor and inactiveTintColor
This commit is contained in:
@@ -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}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user