私は解決できなかった問題があります。本当のネイティブ - x秒後に画面を変更
私のReactネイティブアプリケーションでは、最初に開始画面を表示したいと思います。それから5秒後にもう一度閉じ、別のものを表示してください。どちらも2つの全く異なる画面で、「戻る」矢印を保持する必要はありません。
私は何時間も探していますが、どうやってそれを行うのか分かりませんでした。ここで
は、今の私のコードです:
import Defis from './components/defis'
import Quote from './components/quote'
export default class Betty extends Component {
componentDidMount(){
// Start counting when the page is loaded
this.timeoutHandle = setTimeout(()=>{
// Add your logic for the transition
this.props.navigation.navigate('Defis') // what to push here?
}, 5000);
}
componentWillUnmount(){
clearTimeout(this.timeoutHandle);
}
render() {
return (
<Quote/>
);
}
}
誰もがそれを行う方法を知っていますか?
私はNavigator.push
を使用できません。また、ナビゲータは非推奨と思われます。