Method `jumpToIndex` is deprecated.
Current Behavior
the code in App.js:
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View
} from 'react-native';
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation'
import HomeScreen from './shuidi/home/homeScreen'
import AttentionScreen from './shuidi/attention/attentionScreen'
import MeScreen from './shuidi/me/meScreen'
const HomeStack = StackNavigator({
Home: { screen: HomeScreen }
})
const AttentionStack = StackNavigator({
Attention: { screen: AttentionScreen }
})
const MeStack = StackNavigator({
Me: { screen: MeScreen }
})
export default TabNavigator(
{
Home: { screen: HomeStack },
Attention: { screen: AttentionStack },
Me: { screen: MeStack }
},
{
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
tabBarOptions: {
activeTintColor: 'tomato',
inactiveTintColor: 'gray',
},
animationEnable: false,
swipeEnable: false,
}
)
the code in Screen.js:
import React from 'react'
import { View, Text, Button } from 'react-native'
class HomeScreen extends React.Component {
render() {
return (
<View stype={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home!</Text>
<Button
title="Go to Settings"
onPress={() => this.props.navigation.navigate('Node')}
/>
</View>
)
}
}
export default HomeScreen

My Environment
| software | version |
|---|---|
| react-navigation | 2.2.5 |
| react-native | 0.55.4 |
| node | 8.11.2 |
| npm or yarn | 4.6.1 |
I didn't use createxxx.
I found that problem too , and the version 2.0.1 is ok,it's just a temporary solution.
just run 'npm install [email protected] --save'
hi. the code you provided is not runnable.
as the issue template explains, we require that you provide a runnable example that reproduces the bug on https://snack.expo.io or in a github repository. please try to minimize the superfluous code and focus only on reproducing the bug.
you might wonder, why are we strict about this? the reason is that there are only a small number of maintainers on this project and there are hundreds of people who report issues. if it takes us 20 minutes on average to reproduce each issue and we go through 10 issues each day, that's about half of our day just trying to reproduce bugs, without even beginning to investigate solutions. compare that to 20 minutes for each person who reports an issue.
please create a new issue with this and i'd be happy to review it!