Skip to content

Commit ad59d16

Browse files
authored
1 parent cc355dc commit ad59d16

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/views/TabView/TabBarTop.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ export default class TabBarTop extends React.PureComponent<Props> {
122122
);
123123
};
124124

125-
_handleOnPress = (previousScene: NavigationRoute, scene: TabScene) => {
126-
const { getOnPress, jumpToIndex }: Props = this.props;
125+
_handleOnPress = (scene: TabScene) => {
126+
const { getOnPress, jumpToIndex, navigation }: Props = this.props;
127+
const previousScene = navigation.state.routes[navigation.state.index];
127128
const onPress = getOnPress(previousScene, scene);
128129

129130
if (onPress) {
@@ -136,8 +137,6 @@ export default class TabBarTop extends React.PureComponent<Props> {
136137
render() {
137138
// TODO: Define full proptypes
138139
const props: any = this.props;
139-
const { state } = props.navigation;
140-
const previousScene = state.routes[state.index];
141140

142141
return (
143142
<TabBar

0 commit comments

Comments
 (0)