StackNavigator を次のように設定しました。
const Navigation = StackNavigator({
Splash:{screen: Splash},
Registration:{screen:Registration},
HomeScreen:{screen: HomeScreen},
Login:{screen: Login},
Lobby:{screen: Lobby},
Wifi:{screen: Wifi},
Mobile:{screen:Mobile},
}, {
mode: 'modal',
headerMode: 'none'
});
2 秒後にユーザーをスプラッシュ ページ (ロゴのみを含む) から登録ページにリダイレクトしたいと思います。ユーザーがロゴを簡単に確認できるように、ボタンの使用を避けたい (したがって、自動リダイレクト)。
マイ スプラッシュ ページ:
import React,{Component} from 'react'
import {View, Text, Image, StyleSheet} from 'react-native'
import config from '../components/config/index';
import { StackNavigator, DrawerNavigator } from 'react-navigation';
export default class Splash extends Component{
render(){
const logo = config.images.logo;
const {navigate} = this.props.navigation;
return(
<View style={styles.mainContainer}>
<Image
source={logo}
style={styles.logo}
/>
</View>
);
}
}
これまでにページを変更した唯一の方法は onPress={} を使用していたため、 this.navigator.redirect('Registration') を配置するかどうかはわかりません