fix: NavigationActions.popToTop no longer exists, belongs to StackActions now

This commit is contained in:
Brent Vatne
2018-04-04 18:15:45 -07:00
parent 297835aa57
commit 4633baa98a

View File

@@ -3,7 +3,7 @@
import * as React from 'react';
import {
TabRouter,
NavigationActions,
StackActions,
createNavigator,
createNavigationContainer,
} from 'react-navigation';
@@ -85,7 +85,7 @@ export default function createTabNavigator(TabView: React.ComponentType<*>) {
if (isFocused) {
if (route.hasOwnProperty('index') && route.index > 0) {
navigation.dispatch(NavigationActions.popToTop({ key: route.key }));
navigation.dispatch(StackActions.popToTop({ key: route.key }));
} else {
// TODO: do something to scroll to top
}