Fix tab bar not animating in certain cases
This commit is contained in:
parent
eaf1c52af5
commit
df8f1cab24
1 changed files with 3 additions and 2 deletions
|
@ -59,6 +59,8 @@ class CustomTabBar extends React.Component<PropsType, StateType> {
|
|||
this.state = {
|
||||
translateY: new Animated.Value(0),
|
||||
};
|
||||
// @ts-ignore
|
||||
props.navigation.addListener('state', this.onRouteChange);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,7 +181,7 @@ class CustomTabBar extends React.Component<PropsType, StateType> {
|
|||
if (isFocused) {
|
||||
const stackState = route.state;
|
||||
const stackRoute =
|
||||
stackState && stackState.index
|
||||
stackState && stackState.index != null
|
||||
? stackState.routes[stackState.index]
|
||||
: null;
|
||||
const params: {collapsible: Collapsible} | null | undefined = stackRoute
|
||||
|
@ -196,7 +198,6 @@ class CustomTabBar extends React.Component<PropsType, StateType> {
|
|||
|
||||
render() {
|
||||
const {props, state} = this;
|
||||
props.navigation.addListener('state', this.onRouteChange);
|
||||
const icons = this.getIcons();
|
||||
return (
|
||||
<Animated.View
|
||||
|
|
Loading…
Reference in a new issue