-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (28 loc) · 1.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import 'react-native-gesture-handler'; //has to be first!
import React from 'react'
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';
import MainScreen from './src/MainScreen'
import GameScreen from './src/screens/GameScreen'
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './src/reducers/rootReducer'
import { Provider } from 'react-redux';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import thunk from 'redux-thunk'
const store= createStore(rootReducer,applyMiddleware(thunk));
const Stack = createStackNavigator();
const trivia=()=>(
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator initialRouteName="MainScreen">
<Stack.Screen name="MainScreen" component={MainScreen} />
<Stack.Screen name="GameScreen" component={GameScreen}
options={{
headerLeft:null
}} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
)
AppRegistry.registerComponent(appName, () => trivia);