mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 20:35:19 +08:00
Merge pull request #12 from ericvicenti/@ericvicenti/navigate-fix
Fix tab action in for react nav v2
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
StackActions,
|
||||
createNavigator,
|
||||
createNavigationContainer,
|
||||
NavigationActions,
|
||||
} from 'react-navigation';
|
||||
import SceneView from 'react-navigation/src/views/SceneView';
|
||||
|
||||
@@ -95,7 +96,9 @@ export default function createTabNavigator(TabView: React.ComponentType<*>) {
|
||||
|
||||
_handleIndexChange = index => {
|
||||
const { navigation } = this.props;
|
||||
navigation.navigate(navigation.state.routes[index].routeName);
|
||||
navigation.dispatch(NavigationActions.navigate({
|
||||
routeName: navigation.state.routes[index].routeName,
|
||||
}));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user