-DrawerNavigators
--TimelineNavigators
--- Screen1(initialRoute)
--- Screen2
- SettingsScreen
export const TimelineNavigators = StackNavigator({
'screen1': { screen: Timeline, navigationOptions:Screen1NavigatorOptions() },
'screen2': { screen: LiveMap, navigationOptions:Screen2NavigatorOptions() },
},{initialRoute: 'screen1'});
const routeConfiguration = {
'TimelineNavigators': { screen: TimelineNavigation, navigationOptions: timeLineDrawerOptions },
'SettingsScreen': { screen: SettingsScreen , navigationOptions: settingsDrawerOptions },
};
export const NavigatorAuth = DrawerNavigator(routeConfiguration, drawer
Options());
import { View, Text, Button } from 'react-native';
import { NavigationActions } from 'react-navigation'
class Settings extends Component {
render() {
return (
<View>
<Button onPress={()=> this.props.navigation.navigate('screen2')} title="Go to Screen 2"/>
</View>
);
}
}
export default Settings;
在SettingsScreen上点击按钮(onPress = {()=&gt; {navigation.navigate(&#39; Screen2&#39;)})时,没有任何反应。屏幕没有改变。是bug吗?
在SettingsScreen上点击按钮(onPress = {()=&gt; {navigation.navigate(&#39; Screen2&#39;)})时,必须打开Screen2。
|反应导航| 1.0.0-beta.19
|反应原生的0.49.5
|节点| 6.11.2
| npm或纱线| 5.5.1