1
こんにちは私はExpoを初めて使いましたが、コードを実行しようとして苦労しました。私はエラーを持っているつもりです:You must specify initialRoute or initialStack to initialize this StackNavigation
私はすでにそれを設定しています。ExNavigationでinitialRouteが定義されていないとのエラーが表示される
はここに私のmain.js
import Expo from 'expo'
import React from 'react'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import {
NavigationProvider,
StackNavigation,
} from '@expo/ex-navigation'
import RootReducer from './src/reducers'
import Router from './src/navigation/Router'
const store = createStore(RootReducer)
const App =() => (
<Provider store={store}>
<NavigationProvider router={Router}>
<StackNavigation intitialRoute={Router.getRoute('splash')} />
</NavigationProvider>
</Provider>
)
Expo.registerRootComponent(App)
だここに私のセットアップで問題があると思われるどのような私のRouter.js
import { createRouter } from '@expo/ex-navigation'
// Screens
import SplashScreen from '../screens/SplashScreen'
import LoginScreen from '../screens/LoginScreen'
const Router = createRouter(() => ({
splash:() => SplashScreen,
login:() => LoginScreen,
}))
export default Router
ですか?私はちょうどExNavigation
の例に従った。
私の例はSketchですが、実行することはできませんが、完全なコードのリンクは残しておきます。
何がいいですか!私はそれが睡眠の欠如によって引き起こされているかコピー&ペーストを避けることが "時には"悪い考えであるかどうかわかりません。ありがとうございました! – JohnnyQ